How to get video RTSP link with Youtube API V3?

2019-03-11 10:43发布

问题:

I used to get it normally with V2 but what's the alternative in API V3 ? if not available, is there any hack to do it ? eg. guess the URL ?

Note : V2 is Deprecated now, so i can't depend on it .

回答1:

Yes, this is another of the great advantages of v3 API. Other benefits from this API:

  • No more multiple screenshots to choose from
  • No more video duration; must be requested in second query
  • Video duration encrypted in ISO 8601 format to ensure you can't can convert it to seconds

The lack of RTSP value is just another one. I bet that in API v4 they'll probably hide the video title as well, to ensure the API is entirely useless.



回答2:

API v3 doesn't return RTSP, your best bet is to implement iFrame player and it will stream the appropriate format for you.