iOS:在应用中播放嵌入代码视频

时间:2017-09-05 09:10:46

标签: ios objective-c video webview youtube

我正在制作一个应用程序,我必须在其中显示来自JSON服务器的视频,其中一些是youtube视频,一些来自其他资源。 我的问题是当我想播放视频时,来自youtube链接的视频播放效果很好但其他视频没有播放。 我导入<AVFoundation/AVFoundation.h>, <AVKit/AVKit.h>, MediaPlayer/MediaPlayer.h个文件也导入了YTPlayerView个文件

我在UIWebView

中使用以下代码
[self.webvw setAllowsInlineMediaPlayback:YES];
    [self.webvw setMediaPlaybackRequiresUserAction:NO];

    NSString* embedHTML = [NSString stringWithFormat:@"%@",videoStr];
    [self.webvw loadHTMLString:embedHTML baseURL:[[NSBundle mainBundle] resourceURL]];

其他视频格式如下:

"embed_code": "<object width="430" height="344"><embed width="430" height="344" type="application/x-shockwave-flash" wmode="transparent" src="http://xxxxxxx.xxxxxx/static/jscript/player/flowplayer/flowplayer.swf?config={'clip':{'baseUrl': 'http://myconnect.media/file/video/','url': '2017/02/3d045f0f240bfb73305f77c3da4d9218.flv','autoBuffering': true,'autoPlay': false}}"></embed></object>"

0 个答案:

没有答案
相关问题