Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscriber block does not work when playing the .m3u8 file with ABR enabled. #6172

Closed
Mohit-3196 opened this issue Mar 11, 2024 · 3 comments
Closed
Assignees

Comments

@Mohit-3196
Copy link
Contributor

Short description

When ABR is enabled and playing the .m3u8 file directly, the subscriber block feature/API is not working.

Environment

  • Ant Media Server version: AMS v2.8.2

Steps to reproduce

  1. Enable Time-based One-time Password(TOTP) for Playing.
  2. Enable adaptive streaming/transcoding.
  3. Start a rtmp stream.
  4. Generate the subscriber token for the streamId.
  5. Play the .m3u8 file ffplay -i "https://ams.antmedia.cloud:5443/LiveApp/streams/abcde_adaptive.m3u8?subscriberId=media&subscriberCode=337308"
  6. Call the subscriber block API curl -X 'PUT' 'http://ams-14315.antmedia.cloud:5443/LiveApp/rest/v2/broadcasts/abcde/subscribers/media/block/30/play'

Expected behavior

The playback should stop and the subscriber should be blocked.

Actual behavior

The play continues and the subscriber is not blocked.

It works fine when playing with the embedded player, play.html

Logs

Place logs on pastebin or elsewhere and put links here

Ask your questions on Ant Media Github Discussions

@Mohit-3196 Mohit-3196 changed the title Subscriber block does not work when playing the .mm3u8 file with ABR enabled. Subscriber block does not work when playing the .m3u8 file with ABR enabled. Mar 11, 2024
@lastpeony
Copy link
Contributor

lastpeony commented Mar 12, 2024

I investigated this issue and it appears that when test_adaptive.m3u8 file is requested ffmpeg only passes query parameters on first m3u8 request and afterwards it does not pass subscriberId and subscriberCode to the requests.

Because of this behaviour blocking subscriber on air does not work.

As a workaround solution for ABR case spesific ABR m3u8(teststream_480p1000kbps.m3u8) file can be requested. On this case subscriber block on air will work just like no ABR case.

ffplay -i "http://localhost:5080/WebRTCAppEE/streams/teststream_480p1000kbps.m3u8?subscriberId=lastpeony&subscriberCode=371505"

@Mohit-3196
Copy link
Contributor Author

Thank you @lastpeony for your investigation and the workaround solution.
In case there are multiple Adaptive settings on the server then this solution is not likely to be affective as the users would like the bitrate to switch as per the internet connection.

@lastpeony
Copy link
Contributor

We have a solution for this problem and its on PR.
If someone needs the fix urgently let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

4 participants