ios - 在 UITableview Cell 中播放视频
<p><p>在我的一个应用程序中,我必须在 UITableviewcell 中播放视频,一次在一个单元格中播放一个视频,并且当滚动 UITableview 和单元格隐藏视频时应该停止。我的项目在 Objc 中。</p>
<p>对任何第三方有什么建议吗?</p>
<p>提前致谢</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>在该单元格中使用 UIWebView,它会正常工作</p>
<pre><code> NSString *baseUrl = @"http://www.youtube.com/embed/";
NSString *videoUrl = ;
videoUrl = ;
NSString *embedHTML = @"\
<html><head>\
<style type=\"text/css\">\
body {\
background-color: transparent;\
color: white;\
}\
</style>\
</head><body style=\"margin:0\">\
<embed id=\"yt\" src=\"%@\" type=\"application/x-shockwave-flash\" \
width=\"%0.0f\" height=\"%0.0f\"></embed>\
</body></html>";
NSString *html = ;
UIWebView *videoWebView = [ initWithFrame:CGRectMake(8, 10.0, width-16, (width-16)/1.8)];
;
videoWebView.mediaPlaybackRequiresUserAction = YES;
videoWebView.scrollView.scrollEnabled = NO;
videoWebView.scrollView.bounces = NO;
;
;
</code></pre></p>
<p style="font-size: 20px;">关于ios - 在 UITableview Cell 中播放视频,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/44172987/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/44172987/
</a>
</p>
页:
[1]