Basic PlayList Guide From Zero to Hero #6015
mekya
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Guys,
We've introduced a new REST method to skip playing the next item in the playlist so we think it's helpful some guys there to have a full guide for playlist with a step by step way.
Step 1: Configure Ant Media Server for Better Playlist Experience
Login to your Ant Media Server Web Panel in. The url is like this

https://YOUR_ANT_MEDIA_SERVER:5443/Click the LiveApp on the left

Click the

Settingstab and scroll bottomUncheck the

Delete HLS files after the stream is finishedScroll bottom and Click

SavebuttonScroll top and Choose the mode from

BasictoAdvancedFind
hlsflagsand change its value todelete_segments+append_list+omit_endlistMake Ant Media Server Respond all REST calls (Only For Testing)
If you're going to test the things programmatically, just open the REST API for world. Pay attention that we'll open Ant Media Server to respond all REST methods for testing purposes. It's not something acceptable for production environments.
Find

REST API Securitysection and add0.0.0.0/0to the textarea.Click
Savebutton.Step 2: Upload Some VoD Files for Testing
Click the

VoDTab for LiveApp and then click theUpload VoDbuttonUpload some MP4 VoD Files from your computer

We've added 3 VoD files

Copy the VoD Urls through context menu. We'll use them below.
So my VoDs are accessible through this links and I'll use them below.
http://localhost:5080/LiveApp/streams/243170266880429550645296.mp4http://localhost:5080/LiveApp/streams/794333965265876491918328.mp4http://localhost:5080/LiveApp/streams/823913410113173360449884.mp4Step 3: Manage PlayList Programmatically
This section requires very basic knowledge about terminal usage.
ITEM1,ITEM2andITEM3are VoD URL that we copied. You can copy and paste one line at a time.Ant Media Server responds with generated broadcast JSON object. If you don't give
streamIdin the request above, then Ant Media Server will generate a randomstreamId.Go to web panel and check that its state is "Broadcasting"

http://{MY_ANT_MEDIA_SERVER}:5080/LiveApp/play.html?id={MY_PLAYLIST_ID}&playOrder=hlsPay attention that we use HLS to playback because it provides better experience in playlists and no need to have ultra low latency with WebRTC.
Check that the player that it's skipped. It may take about 10-15 seconds to see that the effect because HLS has this latency.
Bonus: If you give index query parameter when skipping the item in the PlayList, it will skip to that item directly in the playlist. You can add index query parameters by just appending with question mark to the url as follows.
http://${MY_ANT_MEDIA_SERVER}:5080/LiveApp/rest/v2/broadcasts/playlists/${MY_PLAYLIST_ID}/next?index=0The Url above just skips to the first item in the list.
Please try and let me know if you have any questions or stuck in anywhere.
Cheers
Oguz
Beta Was this translation helpful? Give feedback.
All reactions