问题
i have an swf media player which play flv videos but i want it to play youtube videos so i must pass to the player flv file path
the senario is a website which i can upload videos or put a url and i can put a youtube video URL
i am using asp.net and i need a solution whenever i detect a user is entering youtube video i must convert it to flv file path to be played in the player
回答1:
This post explains how to retrieve links of different qualities (FLV and more): youtube get_video not working
However, if you're just going to play the videos, it would be easiest to use Youtube's chromeless player API: http://code.google.com/apis/youtube/flash_api_reference.html
回答2:
You can use a current web service which is already implemented for your project
Use www.keepvid.com to decode the url from YouTube. First go to YouTube and load a video then you copy the url in the address bar and it should show something like this:
http://chi-v48.chi.youtube.com/get_video?video_id=TvedUxLtZKQ
One thing left to do is to add .flv to the end of the url so it ends up like this:
http://chi-v48.chi.youtube.com/get_video?video_id=TvedUxLtZKQ.flv
来源:https://stackoverflow.com/questions/4690985/how-do-i-get-the-flv-file-path-from-a-youtube-url