我是靠谱客的博主 优雅饼干,这篇文章主要介绍iOS APP 中H5视频默认全屏播放,现在分享给大家,希望可以做个参考。

问题描述:在Android中,视频可以正常在H5页面局部播放,iOS中则自动切换至全屏模式,需要禁止视频自动全屏播放。

解决方法:

H5端:

iOS10以上H5视频不自动全屏播放识别 playsinline这个属性
iOS10以下H5视频不自动全屏播放识别 webkit-playsinline这个属性

x5-video-player-type='h5' x5-video-player-fullscreen='true' playsinline webkit-playsinline

iOS 端实现代码:

UIWebView

webView.allowsInlineMediaPlayback = YES;

WKWebView

WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc]init];
    configuration.allowsInlineMediaPlayback = true;
_webview = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight - 88) configuration:configuration];

最后

以上就是优雅饼干最近收集整理的关于iOS APP 中H5视频默认全屏播放的全部内容,更多相关iOS内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(129)

评论列表共有 0 条评论

立即
投稿
返回
顶部