Creating a playlist
It is very simple to create a playlist from the Ant Media Server dashboard by following a set of steps. So let's get started 🙂
VoD files​
To create a playlist, we need to have a set of VoD files that will be used as playlist items. Therefore, as the first step, we will upload some VoD files to the Ant Media Server.
Login to your Ant Media Server Dashboard​
Login to your Ant Media Server Web Panel/dashboard. The URL is like this: https://YOUR_ANT_MEDIA_SERVER:5443/
Accessing the Application​
- Navigate to your preferred application from the left side. For this demonstration, we are using the LiveApp application.
- Once you are in the LiveApp application, go to the VoD section.
Uploading the VoD files​
Using Web Panel​
Now we can upload the VoD files that we want to stream with the playlist.
- Click on the
Upload VoD
tab and then click onChoose File
to select the files you want to upload. For this demonstration, I will upload three VoD files.
Furthermore, uploading MP4 files to your Ant Media Server is optional. Ant Media Server can retrieve MP4 files from any location. You simply need to ensure that the file URL is accessible to AMS.
Using REST API​
You can upload MP4 files to Ant Media Server using the REST API with the following API call:
curl -X POST -F "file=@<YOUR-FILE-PATH>;type=video/*" https://AMS_URL:5443/APP-NAME/rest/v2/vods/create?name=YOUR-FILE-NAME.mp4
Here is the curl sample:
curl -X POST -F "file=@test.mp4;type=video/*" http://localhost:5080/WebRTCAppEE/rest/v2/vods/create?name=test.mp4
The uploaded file will be located in antmedia/webapps/APP-NAME/streams
directory. The MP4 file name will be changed to a random VOD ID, which you can find in the VOD section of the web panel application page.
You can use the Get VOD list rest API call to get the VOD file list from the database.
You can access the uploaded VOD file through the below URL format:
http(s)://domain_or_IP:Port/AppName/streams/VOD-ID.mp4
Example:
http://localhost:5080/WebRTCAppEE/streams/722484094956241856650105.mp4
Creating the Playlist​
Now that we have the VoD files ready, we will create the playlist with these VoD files as the playlist items.
- Go to the
Live Streams
section, clickNew Live Stream
, and then selectPlaylist
from the drop-down menu.
- Name your playlist, and click on
Add Playlist Item
. Under the dropdown menu, there are two options.
- Add URL Directly
- Add From VODs
- Let's discuss both options and you can use any of these options based on your convenience.
Add URL Directly​
If you have the VoD URL handy or are adding external VoDs, you can use this option.