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

Stop playing/publishing using play token #4809

Closed
lastpeony opened this issue Feb 8, 2023 · 3 comments
Closed

Stop playing/publishing using play token #4809

lastpeony opened this issue Feb 8, 2023 · 3 comments
Assignees

Comments

@lastpeony
Copy link
Contributor

lastpeony commented Feb 8, 2023

Feature request:
Users of AMS should be able to stop playing for protocols webrtc, hls and dash using play token.
Implement force-stop publishing using play token.

Possible Solution:
Implement a token black list.
If token is in blacklist hls/dash should stop(need proof of concept) and webrtc should stop after client is disconnected first.
If token is black listed user should not be able to publish, not sure if this will stop already publishing user.

@lastpeony lastpeony self-assigned this Feb 21, 2023
@mekya
Copy link
Contributor

mekya commented Feb 27, 2023

Thank you for the issue @lastpeony

I agree with you. I'm just thinking about the implementation because making it simple/easy is critical.

lastpeony pushed a commit that referenced this issue Feb 28, 2023
lastpeony pushed a commit that referenced this issue Feb 28, 2023
lastpeony pushed a commit that referenced this issue Feb 28, 2023
lastpeony pushed a commit that referenced this issue Feb 28, 2023
lastpeony pushed a commit that referenced this issue Mar 1, 2023
lastpeony pushed a commit that referenced this issue Mar 1, 2023
lastpeony pushed a commit that referenced this issue Mar 1, 2023
lastpeony pushed a commit that referenced this issue Mar 1, 2023
lastpeony pushed a commit that referenced this issue Mar 2, 2023
jwt. blacklist using already existed token db with flag
lastpeony pushed a commit that referenced this issue Mar 2, 2023
jwt. blacklist using already existed token db with flag
lastpeony pushed a commit that referenced this issue Mar 2, 2023
jwt. blacklist using already existed token db with flag
@Mohit-3196
Copy link
Contributor

Hello,
I have tested these implementations with a standalone server and a cluster and it is working fine.

Below are the test scenarios.

Stop WebRTC playback

  1. Blaclist the JWT player token
  2. Get the WebRTC viewerId for the stream with getWebRTCViewerList call
  3. Stop WebRTC viewer with stopPlaying call

Stop HLS/Dash Playback
The HLS and Dash viewers can be stopped by blacklisting the JWT play token.

Stop a Publishing stream

  1. Blacklist the JWT publish token.
  2. Force the stream to stop with stopStreaming API call.

If the token(s) is removed from the blacklist, then it can be used to publish/play the streams again.

There are two more utility API calls
/jwt-black-list-delete-expired It deletes all expired and blacklisted tokens from the database once the token is expired
/jwt-black-list-clear This API call whitelists all blacklisted JWT tokens. Currently, it is using the DELETE method so it needs to be revised with POST method.

Thank you

@lastpeony
Copy link
Contributor Author

Use subscriber block feature to achieve same functionality.
Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants