ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.31k stars 636 forks source link

Broadcasting a Playlist is failing when "Play with JWT Tokens" is enabled #6727

Open amarantmeida opened 1 month ago

amarantmeida commented 1 month ago

Short description

Broadcasting a Playlist is failing with "Start Stream failed" error, when "Play with JWT Tokens" is enabled

Environment

Steps to reproduce

  1. Create a Playlist
  2. Add VOD to playlist
  3. Enable "Play with JWT tokens" option and save
  4. Start Broadcast for the playlist

Expected behavior

Broadcast should start and should be playable for players

Actual behavior

Broadcast is failing with "Stream Start failed"

Logs

Place logs on pastebin or elsewhere and put links here

Ask your questions on Ant Media Github Discussions

muratugureminoglu commented 1 month ago
Agent Amarnath Thodupunoori linked Freshdesk ticket 133837 for this issue.

lastpeony commented 4 weeks ago

The issue occurred because the server checks if the VoD file is accessible before initiating the playlist fetching process. When play-access token security is enabled for the app, the server cannot access the VoD file, preventing it from starting the playlist.

After discussing with @mekya , we decided to keep the solution simple and implement the fix on the client side.

In the referenced PR, if a VoD file is added via file selection and JWT play security is enabled, the web panel now automatically generates a JWT token and appends it to the VoD file URL. This allows the server to access the file, resolving the issue.

Additionally, for direct VoD URL additions, I’ve enhanced the inaccessible URL error message to remind users to add a token if play-access security is enabled.

Please note that automatic token addition only applies to JWT security. If OTT play security is enabled, the web panel will not generate or append a token to the URL, leaving this responsibility to the user.