You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a Data URI: If you want to avoid serving the M3U8 file over a separate protocol, you can convert the M3U8 file to a data URI and embed it directly into your HTML file. This way, there won't be any mixed content issues since everything is within the same protocol.
Here's an example of how to convert an M3U8 file to a data URI and embed it in your HTML:
Yes, but not directly or officially (there are no tests or examples in test-streams). Try passing a data URI to hls.loadSource() (it works). Data URIs are handled in the loader via XHR (they are not parsed or decoded by HLS.js using atob). This is how EXT-X-KEY tag data URIs are handled.
path_to_segment_2.ts
Note that keys and segments in the encoded playlist must use absolute URLs in the asset - relative paths will not be resolved with a base data URI.
What do you want to do with Hls.js?
Use a Data URI: If you want to avoid serving the M3U8 file over a separate protocol, you can convert the M3U8 file to a data URI and embed it directly into your HTML file. This way, there won't be any mixed content issues since everything is within the same protocol.
Here's an example of how to convert an M3U8 file to a data URI and embed it in your HTML:
var m3u8Data =
#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:10 #EXTINF:10.000, path_to_segment_1.ts #EXTINF:10.000, path_to_segment_2.ts #EXT-X-ENDLIST
;var videoPlayer = document.getElementById('videoPlayer');
// Set the data URI as the source for the video player
videoPlayer.src = 'data:application/x-mpegURL;base64,' + btoa(m3u8Data);
What have you tried so far?
No response
The text was updated successfully, but these errors were encountered: