HTML5视频播放无法与Safari(Mac和iOS)一起使用

时间:2016-02-03 20:31:35

标签: html5 video safari mobile-safari

我的某个网站上有一些视频。视频使用HTML5视频标记,并在呈现标记时使用最佳做法。它在Chrome,Firefox,Edge甚至Internet Explorer中运行良好。 Safari除外!即便Facebook检测视频和分享作品也很完美。

在Safari中,它会检测视频,加载浏览器控件,但播放功能不起作用。我不认为它是视频标签的问题,因为当我在新标签中打开视频时,它也不起作用。我尝试使用miro video converter和Apple的设置对视频进行重新编码,但没有任何改变。我可以下载视频并使用Mac Preview进行播放,没有任何问题。

作为附加信息,我在IIS 7上使用ASP.net。

我在控制台中看到此错误:Failed to load resource: Plug-in handled load

以下是其中一个页面:https://www.parscanada.com/_104189

以下是Safari for Mac页面的屏幕截图: screen shot of the page on Safari for Mac

以下是Safari for iOS(仿真器 - 与设备相同)页面的屏幕截图: screen shot of the page on Safari for iOS (Emulator - Same as device)

1 个答案:

答案 0 :(得分:-3)

问题解决了,使用了来自Scott Mitchel的代码http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx(链接已经死了,但您可以在archive.org中找到它)

将正确的标头发送回Safari请求似乎是一个问题。我用原始代码替换了部分Scott代码,一切似乎都运行正常。

以下是苏格兰代码摘要:

/// <summary>
/// An abstract HTTP Handler that provides resumable file downloads in ASP.NET.
/// 
/// Created by:
///     Scott Mitchell
///     mitchell@4guysfromrolla.com
///     http://www.4guysfromrolla.com/ScottMitchell.shtml
/// </summary>
/// <remarks>
/// This class is a fairly close port of Alexander Schaaf's ZIPHandler HTTP Handler, which I found online at:
/// 
///     Tracking and Resuming Large File Downloads in ASP.NET
///     http://www.devx.com/dotnet/Article/22533/1954
/// 
/// I also found a similar version of this code in the download for the September 2006 issue of MSDN Magazine:
/// http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/MSDNMag2006_09.exe
/// 
/// Alexander's code is in Visual Basic and was written for ASP.NET version 1.x. I ported the code to C#,
/// refactored portions of the code, and made use of functionality and features introduced in .NET 2.0 and 3.5.
/// </remarks>