YouTube 嵌入 AirPlay UIWebView [英] YouTube embed AirPlay UIWebView
问题描述
我正在开发一个视频应用程序,其中包含来自不同来源的大量视频.应用程序中的选项之一必须是在电视上通过 Airplay 播放视频.
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.
为了在我的应用程序中显示 YouTube 视频,我使用了 YTPlayerView,它是 YouTube API 的 Objective-C 助手.
For displaying YouTube video in my application I am using YTPlayerView, which is an objective-C helper for the YouTube API.
我的问题是:有没有我可以传递的选项或参数,以便 YouTube 视频也可以通过 Airplay 播放?我在互联网上找不到任何有用的东西.
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.
推荐答案
In - (BOOL)loadWithPlayerParams:(NSDictionary *)additionalPlayerParams
in YTPlayerView.m
(
In - (BOOL)loadWithPlayerParams:(NSDictionary *)additionalPlayerParams
in YTPlayerView.m
(line 617), add:
self.webView.mediaPlaybackAllowsAirPlay = YES;
就在你返回YES
之前.
这篇关于YouTube 嵌入 AirPlay UIWebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!