最新 iOS 更新 (12.2) 后,本地存储中的视频未在 WebView (Xamarin.Forms) 中播放 [英] Video from local storage not playing in WebView (Xamarin.Forms) after latest iOS update (12.2)

查看:18
本文介绍了最新 iOS 更新 (12.2) 后,本地存储中的视频未在 WebView (Xamarin.Forms) 中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的 Xamarin Forms 应用程序,适用于 Android 和 iOS,它在 WebView 中显示来自本地存储的一些 HTML 内容(目的是在脱机时查看这些内容).

I have an existing Xamarin Forms application, for Android and iOS, which shows some HTML content from local storage (the purpose is to view this content while offline) in WebView.

在最新的 iOS 更新 (12.2) 之后,该 HTML 中的视频停止工作.视频所在位置显示白色背景,带有播放"符号,但无法进行任何操作.

After the latest iOS update (12.2), the videos in that HTML stopped working. White background is shown on the place of the video, with the symbol "Play" but no action is possible.

我尝试将视频标签更改为包含自动播放、静音,但没有成功.

I have tried changing the video tag to include autoplay, mute, but no success.

<video width="560" height="315" controls>
<source src="Absolute-3D.mp4" type="video/mp4">
</video>

我希望它能够像更新前一样继续工作,但有些东西阻止了它.

I expect it to continue working as it was before the update, but something is blocking it.

推荐答案

这是一个 UIWebView 错误,我添加了以下代码,现在可以使用了.

It is a UIWebView bug , I add the below code, it works now.

self.webView.mediaPlaybackRequiresUserAction = NO;
self.webView.allowsPictureInPictureMediaPlayback = YES;

这篇关于最新 iOS 更新 (12.2) 后,本地存储中的视频未在 WebView (Xamarin.Forms) 中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆