Soccer is not an issue. It has origins dating back to many ancient civilizations including the Greeks, Romans, Chineeze, and various Mesoamerican civilizations which all independently developed similar games that influenced modern soccer which was standardized by the British Empire in 1863. The earliest versions of these balls in Europe were made from seeds or hair tightly wrapped in linen, and your medieval people would likely already know how to make these balls and already be playing games very similar to soccer.
Basketball is a much trickier issue. Of the early soccer like games, only Tlachtli used a bouncy rubber ball that would have made basketball possible prior to the invention of modern inflated vulcanized rubber balls. The game goes back over 3000 years to about the time that natural rubber was discovered. Even though rubber was not first seen in Europe until the 16th century AD, it is now known that there are a few thousand species of plants that can be used to make various kinds of natural rubbers. Tlachtli balls were made out of solid rubber so they would be much heavier than a basketball, but they still would have dribbled well enough to make the game a possibility.
If your timetaveler has as decent understanding of modern botany, he would probably be able to figure out how to make his own version of a Tlachtli ball using just the plants found in nature around him. Sulfur has also been used for various things since the ancient times; so, if your time traveler also has a general understanding of chemistry, he could make vulcanized rubber and therefore modern balls. If he has a more advanced understanding of modern botany, he would also know that that certain plants have curative properties that create results similar to vulcanization when combined with natural latex.
In short, if your time traveler is just a random schmuck thrust back in time, he probably won't be able to play basketball, but if he is scientifically minded enough, it won't be hard to make one from local resources.