########################################################################################## VID-5: M3U Support ########################################################################################## Issue Type: New Feature ----------------------------------------------------------------------------------------- Issue Information ==================== Priority: Major Status: Closed Resolution: Done (2019-12-15 13:35:04) Project: Videos.bentasker.co.uk (VID) Reported By: btasker Assigned To: btasker Targeted for fix in version: - v0.15 Time Estimate: 0 minutes Time Logged: 0 minutes ----------------------------------------------------------------------------------------- Issue Description ================== Surprising as it may be, VideoJS does not natively support M3U format playlists. I hacked together a translator yesterday whilst fooling around with something else, so it'd be good to take that work and translate it into something which can be used here. Essentially, what's needed is to fetch the M3U and iterate over its items in order to build a JSON object which can then be passed into the videojs-playlist plugin (may also want to consider adding support for videojs-playlist-ui at the same time). ----------------------------------------------------------------------------------------- Issue Relations ================ - relates to VID-15: Custom Playlist Format support ----------------------------------------------------------------------------------------- Activity ========== ----------------------------------------------------------------------------------------- 2019-04-02 17:42:42 ----------------------------------------------------------------------------------------- btasker added 'VNEXT' to Fix Version ----------------------------------------------------------------------------------------- 2019-04-02 17:42:42 ----------------------------------------------------------------------------------------- btasker removed 'v0.13' from Fix Version ----------------------------------------------------------------------------------------- 2019-04-19 11:56:49 ----------------------------------------------------------------------------------------- btasker added 'VNEXT' to Fix Version ----------------------------------------------------------------------------------------- 2019-04-19 11:56:49 ----------------------------------------------------------------------------------------- btasker removed 'v0.14' from Fix Version ----------------------------------------------------------------------------------------- 2019-12-15 11:29:35 btasker ----------------------------------------------------------------------------------------- One thing to note about the implementation referred to in the description, it was set up so that it could play indefinitely - refetching the playlist and appending the contents periodically. This eventually leads to browser tab lockups as we consume an ever increasing amount of memory. ----------------------------------------------------------------------------------------- 2019-12-15 11:33:19 btasker ----------------------------------------------------------------------------------------- The method used in that original hacked together implementation is fairly simple. It places a XMLHttpRequest for the M3U, using an onload JS event to call function parseM3U once the playlist has been fetched. -- BEGIN SNIPPET -- function parseM3U(){ window.videoList = [] lines = this.responseText.split('\n'); domain = window.location.hostname; var o; for (var i=0; i