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

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

问题描述

我有一个适用于Android和iOS的Xamarin Forms应用程序,该应用程序在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天全站免登陆