Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sitecore Media Library Not Compatible with iOS?

I am running into an issue playing a properly encoded video on an iOS device. Here is some background/information:

  • We are using jwPlayer for playback
  • The video plays great through flash and HTML5
  • The video was encoded through zencoder's default settings
  • We are serving video from the same server which works on iOS devices (but that site is not Sitecore)
  • The video plays on my iPad when synced through dropbox

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):

$ 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? If so, is there a way to get sitecore to serve the media properly?

Edit: Also, if it makes any difference at all, we are on 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)
like image 451
sestocker Avatar asked Jun 29 '11 18:06

sestocker


2 Answers

I had a similar issue which I posted on the SDN. It was about getting videos to play on the iPad and be served from the Media Library. 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). You may want to try to see if you can override the MediaRequestHandler.

like image 179
Mark Ursino Avatar answered Oct 05 '22 01:10

Mark Ursino


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:

    <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".

  3. Went into the server, and deleted all files under "C:\inetpub\wwwroot\Sitecore62\Website\App_Data\MediaCache"

I had different header values under Curl, but the wrong mime-type was consistent with yours. Once I did all of the above the mime-type was returned properly and the video played - HTML below:

<video class="video-js" width="640" height="360"  autoplay controls loop>
  <source src="http://<server>/~/media/client/videos/video.mp4" type="video/mp4" />
</video>
like image 41
sbkrogers Avatar answered Oct 05 '22 00:10

sbkrogers