Perform a check before playing a video in a playlist #7544
mrjackcitrus
started this conversation in
General
Replies: 2 comments 1 reply
-
You probably want to look into middleware and either use the |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thanks for pointing me in the right direction, @gkatsev. As per your recommendation, I have used middleware to achieve what I was trying to do. Here's what I did for anyone that might be interested in the future (it's pseudocode, but you'll get the idea).
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a videoJS playlist loaded in the video player.
Each video source in the playlist consists of a presigned URL that expires in X number of seconds.
I know exactly when the videos expire and I can obtain fresh signatures to extend their expiry time if required. There will be scenarios when this needs to happen, for example, if the viewer pauses the playlist and comes back to it later.
Upon the user pressing play (or selecting a new item on the playlist) I want to perform something like the following pseudocode:
I tried listening out for videoJS's
play
event in the hope I could perform my expiry check here and then somehow stop the rest of the default chain of events from occurring if they had expired. But so far I've not been able to find a way to stop this.Perhaps I need to reconfigure the event listeners for the player's default controls?
Any advice would be gratefully welcomed.
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions