我正在制作一个应用程序,我必须在其中显示来自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>"