简体   繁体   English

Sitecore 媒体库与 iOS 不兼容?

[英]Sitecore Media Library Not Compatible with iOS?

I am running into an issue playing a properly encoded video on an iOS device.我在 iOS 设备上播放正确编码的视频时遇到问题。 Here is some background/information:这是一些背景/信息:

  • We are using jwPlayer for playback我们正在使用 jwPlayer 进行播放
  • The video plays great through flash and HTML5该视频通过 flash 和 HTML5 播放效果很好
  • The video was encoded through zencoder's default settings视频是通过 zencoder 的默认设置编码的
  • We are serving video from the same server which works on iOS devices (but that site is not Sitecore)我们正在从同一台服务器提供视频,该服务器可在 iOS 设备上运行(但该站点不是 Sitecore)
  • The video plays on my iPad when synced through dropbox通过保管箱同步时,视频在我的 iPad 上播放

Through some investigation and some help from the great support staff at Zencoder, we think the issue may be related to the headers (top is the video that does not work, bottom works fine):通过一些调查和 Zencoder 强大支持人员的一些帮助,我们认为问题可能与标题有关(顶部是不起作用的视频,底部是正常的):

$ curl -I http://fraternity.computol.com/~/media/Fraternity/mp4/leadership_zen.mp4
HTTP/1.1 200 OK
Date: Wed, 29 Jun 2011 16:30:29 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment; filename="leadership_zen.mp4"
Transfer-Encoding: chunked
Set-Cookie: fraternity#sc_wede=1; path=/
Cache-Control: public, max-age=604800
Expires: Wed, 06 Jul 2011 16:30:29 GMT
Last-Modified: Wed, 29 Jun 2011 16:28:26 GMT
ETag: 9cba9593424645bfb372a01bfe522f97
Content-Type: application/octet-stream

$ curl -I http://www.rhythmonthevine.org/videos/SHR_ROTV_Dierks_v02.mp4
HTTP/1.1 200 OK
Content-Length: 16091772
Content-Type: video/mpeg
Last-Modified: Thu, 24 Mar 2011 14:05:49 GMT
Accept-Ranges: bytes
ETag: "8374ff932ceacb1:335c"
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Date: Wed, 29 Jun 2011 16:30:32 GMT

Does anyone have any idea whether this issue is actually header related?有谁知道这个问题是否真的与 header 相关? If so, is there a way to get sitecore to serve the media properly?如果是这样,有没有办法让 sitecore 正确地为媒体提供服务?

Edit: Also, if it makes any difference at all, we are on IIS6.编辑:另外,如果它有任何区别,我们在 IIS6 上。

Edit: The particularly troublesome differences are:编辑:特别麻烦的区别是:

  • Transfer-Encoding (the one that is not working is chunked)传输编码(不工作的被分块)
  • Content length (missing on the top video)内容长度(顶部视频中缺少)
  • Content type (I think this is the big one. I have the proper mime type setup in sitecore - I don't what Sitecore is not serving it)内容类型(我认为这是一个大问题。我在 sitecore 中设置了正确的 mime 类型 - 我不知道 Sitecore 没有提供什么)

I had a similar issue which I posted on the SDN.我在SDN上发布了类似的问题。 It was about getting videos to play on the iPad and be served from the Media Library.这是关于让视频在 iPad 上播放并从媒体库提供服务。 The useful response was that the Sitecore media request HTTP handler ( sitecore_media.ashx ) delivers the media responses in chunk ( HTTP transport, Transfer-Encoding: chunked ), which conflicts with the Apple protocol (response must be delivered in one chunk to the client).有用的响应是 Sitecore 媒体请求 HTTP 处理程序 ( sitecore_media.ashx ) 以块的形式提供媒体响应 ( HTTP transport, Transfer-Encoding: chunked ),这与 Apple 协议冲突(响应必须以一个块的形式交付给客户端)。 You may want to try to see if you can override the MediaRequestHandler.您可能想尝试查看是否可以覆盖 MediaRequestHandler。

I ran into the same issue, and was able to get past it through a few things:我遇到了同样的问题,并且能够通过几件事来解决它:

  1. I added the mime-type to MimeType.config as below:我将 mime-type 添加到 MimeType.config 如下:

     <mediaType extensions="mp4"><mimeType>video/mp4</mimeType></mediaType>
  2. Went into the item in the Media Library, and changed the Mime Type of the Item to be "video/mp4".进入媒体库中的项目,并将项目的 Mime 类型更改为“video/mp4”。

  3. Went into the server, and deleted all files under "C:\inetpub\wwwroot\Sitecore62\Website\App_Data\MediaCache"进入服务器,删除“C:\inetpub\wwwroot\Sitecore62\Website\App_Data\MediaCache”下的所有文件

I had different header values under Curl, but the wrong mime-type was consistent with yours.我在 Curl 下有不同的 header 值,但错误的 mime 类型与您的一致。 Once I did all of the above the mime-type was returned properly and the video played - HTML below:一旦我完成了上述所有操作,mime 类型就会正确返回并播放视频 - 下面是 HTML:

<video class="video-js" width="640" height="360"  autoplay controls loop>
  <source src="http://<server>/~/media/client/videos/video.mp4" type="video/mp4" />
</video>

I gave Mark a +1 but I'll offer an alternative as well, could you work around the issue by serving the content through mirroring on a CDN (such as Akamai) or host it entirely on a video CDN (such as Bits on the Run (http://www.longtailvideo.com/bits-on-the-run/)?我给了 Mark +1,但我也会提供一个替代方案,您能否通过在 CDN(例如 Akamai)上镜像提供内容来解决此问题,或者将其完全托管在视频 CDN(例如 Bits on the跑(http://www.longtailvideo.com/bits-on-the-run/)?

This would likely result in lower bandwidth cost and better performance as well, rather than constantly serving video from Sitecore.这可能会导致更低的带宽成本和更好的性能,而不是不断地从 Sitecore 提供视频。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM