2

I need to handle videos retrieved from OwnCloud through a C# WebAPI and sent using a Stream object from C# WebAPI to HTML. But the video tag is not working on IOS/Safari browser while using direct link for the same video is working fine. How can we solve this issue using the same technique?

Code Example:

using (var client = new HttpHelper(_serverAddress + filepath))
{
    client.Authorization(_secret);
    return new FileStreamResult(await client.Get(), "video/mp4");
}

<video width="320" height="240" controls="true" src="http://ip:5000/api/cloud/video"> 
    <source src="http://ip:5000/api/cloud/video" type="video/mp4"> 
</video> 
  • i have found a solution that worked in this link: https://stackoverflow.com/questions/34047247/how-to-stream-a-video-or-a-file-considering-request-and-response-range-headers/35920244#35920244 – Mohamed Sobeh Apr 19 '18 at 10:25

1 Answers1

0

Do you use autoplay? Safari on iOS (and macOS) restricts autoplay. If so, this article will help you. https://bitmovin.com/play-not-play-new-autoplay-policies-safari-11-chrome-64/

  • Do you check HTTP request? Your streaming server needs to support byte-range requests for Safari on iOS. https://stackoverflow.com/questions/3397241/does-iphone-ipad-safari-require-accept-ranges-header-for-video https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html#//apple_ref/doc/uid/TP40006514-SW6 – mclemore_oto Apr 18 '18 at 09:34
  • You can support range-request like the following article. https://blogs.msdn.microsoft.com/webdev/2012/11/23/asp-net-web-api-and-http-byte-range-support/ – mclemore_oto Apr 20 '18 at 05:07
  • thanks, this solution here worked https://stackoverflow.com/questions/34047247/how-to-stream-a-video-or-a-file-considering-request-and-response-range-headers/35920244#35920244 – Mohamed Sobeh Apr 24 '18 at 07:03