0

I recently upgraded my account on Vimeo to be able to get my direct source file on a MP4 extension. Vimeo showed me several quality available for each of my videos.

I was wondering if there is a way to serve the user a specific quality based on its connexion?

By default I serve a SD quality video.

ich_cb
  • 99
  • 8
  • What have you tried so far? – Djave Oct 18 '18 at 12:30
  • Unfortunately due to too many unknowns, PHP cannot accurately determine a users connection speed to the server. However JavaScript with some AJAX can. Take a look at this post here: https://stackoverflow.com/questions/5529718/how-to-detect-internet-speed-in-javascript You could run it to detect estimated speed returned in Mbps and serve the link that best suits. Although I would recommend allowing the user to decide. – Niall Lonergan Oct 18 '18 at 14:01
  • @NiallLonergan Yes I have see and tried this option. But I wanted to avoid making the users download files just to check their speed. Especially if the file need to be on a certain size to fully rely on the speed. – ich_cb Oct 19 '18 at 13:03

2 Answers2

1

In the same response as the MP4 video file direct links, you should see an .m3u8 link. This link is an HLS manifest file that is used for adaptive streaming. You'll need to check if the player you're using supports HLS.

HLS documentation can be found here: https://developer.apple.com/streaming/

Tommy Penner
  • 2,910
  • 1
  • 11
  • 16
  • Thank you for your reply about ".m3u8" link. I didn't know about it. I'm using VIDEOJS as a player. I'm searching now how to get a grab on the m3u8 file from my vimeo account. – ich_cb Oct 19 '18 at 13:09
0

Thank you Tommy.

I was able to finally combine videojs + http-streaming and my .m3u8 link from VIMEO.

Note: It's important for people to have a VIMEO pro account if you want to be able to get your video source URL. Also the type must be ="application/x-mpegURL" and not the default "video/mp4".

 <video-js id=vid1 width=600 height=300 class="vjs-default-skin" controls>
  <source src="https://example.com/index.m3u8" type="application/x-mpegURL">
 </video-js>
 <script src="video.js"></script>
 <script src="videojs-http-streaming.min.js"></script>
 <script>
  var player = videojs('vid1');
  player.play();
 </script>
ich_cb
  • 99
  • 8