Videojs, How to update m3u8 playlist dynamically - http-live-streaming

I want to add new incoming chunks from backend to the player which is already plaing "live" m3u8 playlist
This is an existing playlist (already set and playing)
#EXTM3U
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:6
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PROGRAM-DATE-TIME:2018-10-19T16:39:07Z
#EXTINF:6.000,
56-06000.ts
#EXTINF:6.000,
56-06000.ts
#EXTINF:6.000,
56-06000.ts
#EXTINF:6.000,
56-06000.ts
#EXT-X-ENDLIST
This is an updated playlist, I want to replace old playlist (listed under) with the next one, but I don't want to reload videojs player with comand (player.src(...))
#EXTM3U
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-TARGETDURATION:6
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-PROGRAM-DATE-TIME:2018-10-19T16:39:07Z
#EXTINF:6.000,
56-06000.ts
#EXTINF:6.000,
56-06000.ts
#EXTINF:6.000,
56-06000.ts
#EXTINF:6.000,
56-06000.ts
....
....
many another chunks
....
....
#EXT-X-ENDLIST
How can I do this? Or maybe any other good way to update playlist is existing?

Change the playlist type to EVENT, and don’t write an end tag. Then the player will keep requesting an updated playlist. For more information, please read the spec. https://www.rfc-editor.org/rfc/rfc8216

Related

Adding params on mp3 audio for shortcode [audio] in Wordpress

Using the shortcode audio in Wordrepss [audio src="some-file.mp3"] (this one returns an audio player),
I'm trying to add some params after the file extension: [audio src="some-file.mp3?param1=some-value&param2=somo-value-two"] etc, but I can see that the shortcode do not retuns the player, this one returns an link to the audio.
Were you able to achieve this somehow?
Thanks.

Can you have an MPEG Dash File Pointing To Other MPEG Dash Files?

I'd like to assemble an mpeg dash playlist where I splice together multiple MPEG-Dash URLS to form a single cohesive movie.
MPEG-Dash URL 1 Start #00:10 End #00:30
MPEG-Dash URL 2 Start #01:00 End #05:00
MPEG-Dash URL 3 Play Whole File
Is this possible without breaking open all the files and creating a bunch of different periods with the individual AdaptionSet/SegmentTemplates/Timelines copied from the child streams? My worry is if I open up every file individually and one of the child streams is re-formatted everything will break.
This post mentions someone doing a dash-cast, but I'm trying to keep it in (static) MPD format since we have a player that already supports that.
Is this perhaps what SegmentURL is for?
The DASH specification supports the XML Linking Language (XLink), so you can include references to remote content such as a Period element.
Here is an example, from a DASH test file:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" profiles="urn:mpeg:dash:profile:isoff-live:2011" minBufferTime="PT1.5S" type="static" mediaPresentationDuration="PT1M12S">
<Period xlink:href="https://se-mashup.fokus.fraunhofer.de/dashjs/period_timescapes" xlink:actuate="onLoad"></Period>
</MPD>

HLS Split and Serve Playlist

I want to split and serve a m3u8 playlist to a hls.js client running in a browser. The playlist is big and split and serve is the only option.
When I split and serve till BigBuckBunny_4000_00004.ts as given by the playlist below, movie played till that file. hjs.js fails to play the next sequence of files, even though the rest of the playlist content was served on a subsequent request.
I have tried to add m3u8 header, line 1-6 on every request, the effect was same. Whereas the movie play time was updated in this case.
I couldn't understand the behavior of hls.js client. Please clarify!
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-KEY:METHOD=AES-128,URI=BigBuckBunny.key, IV=0x22725d47cccd5db2834c1f1ec375df73
#EXT-X-TARGETDURATION:7
#EXTINF:6.083333,
BigBuckBunny_4000_00000.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00001.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00002.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00003.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00004.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00005.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00006.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00007.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00008.ts
#EXTINF:6.000000,
BigBuckBunny_4000_00009.ts
#EXT-X-ENDLIST

Embed audio to save bandwidth? To embed or stream?

<audio controls>
<source src="/audio/{$link_data.ID}.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
I have a mix of text like pages in a book, images and audio on my website. When you move from page to page a new mp3 is being loaded and sometimes images.
Sometimes people only read the text or play the audio or a mix of the two.
I was wondering what the best way is to have the audio available without it downloading (on each new page). By being available I mean that you would press the play button before it started to stream the audio.
Just set preload="none".
<audio controls preload="none">
The media will not begin downloading until requested by the user.
Reference:
http://www.w3.org/TR/html-markup/audio.html#audio.attrs.preload

HTML5 audio link masking?

I'm trying to create a mobile ready audio player. However, I'm wondering if it's possible to "mask" the src so that a user couldn't view source and download the mp3. I'm definitely a n00b, so any simple direction would be extremely helpful (IE - use 'x' to do 'y'). I don't necessarily need code examples. Thanks!
Current:
<audio src="unreleased_track01mp3">
...
</audio>
What I'd like:
<audio src="01238134781239871">
...
</audio>
No.
You could attempt to stream the audio, but if you want to play a specific file, the user will always be able to download it if the user is able to listen to it.

Resources