YouTube embed AirPlay UIWebView

拈花ヽ惹草 提交于 2019-12-10 17:04:52

问题


I am developing a video application which contains a lot of video from different sources. One of the options in the application has to be to play videos through airplay on a TV.

For displaying YouTube video in my application I am using YTPlayerView, which is an objective-C helper for the YouTube API.

My question is: is there an option or param I can pass so the YouTube video can also be played through Airplay? I couldn't find anything useful on Internet.


回答1:


In - (BOOL)loadWithPlayerParams:(NSDictionary *)additionalPlayerParams in YTPlayerView.m (line 617), add:

self.webView.mediaPlaybackAllowsAirPlay = YES;

right before you return YES.



来源:https://stackoverflow.com/questions/26872364/youtube-embed-airplay-uiwebview

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