scheme to open a youtube playlist on a iOS device

痴心易碎 提交于 2019-12-24 07:39:12

问题


I want to know a scheme to open a Youtube playlist.

I have this code:

if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString      stringWithFormat:@"youtube://playlist?list=PLgrYntDWyYDdHwZney5QoTDFQrphRmYoK"]]]//https://twitter.com/cms24es
    ) {

}else if ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://twitter.com/TmrrrsApp"]]]//https://twitter.com/cms24es
          ) {

}

I know a scheme to open a video, if I use youtube://, but to open a playlist instead I don't know how.


回答1:


Well I guess youtube doesn't understand browser URL of playlist like this -

http://www.youtube.com/playlist?list=PLgrYntDWyYDdHwZney5QoTDFQrphRmYoK

Alternatively, go to your video->playlist -

Right click on the playlist and select "copy link address"

It provides a link something like this -

http://www.youtube.com/watch?v=ILwOQV32rHg&list=FLLpWow4PGIVkCJifJxrMfwA

Use this as a URI to play in native youtube app.

youtube://www.youtube.com/watch?v=ILwOQV32rHg&list=FLLpWow4PGIVkCJifJxrMfwA


来源:https://stackoverflow.com/questions/14424293/scheme-to-open-a-youtube-playlist-on-a-ios-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!