If the user decides the exact playback time, you can use the rufus-scheduler gem.
Connect your time received from the user:
scheduler = Rufus::Scheduler.start_new scheduler.at @user_defined_time do some_method end
Your some_method can work in tandem with a socket.io wrapper, such as Juggernaut , which will send a message to the user's browser, in which several JSs will be executed that will extract the video and play it.
What you could do with this is basically in your browser’s open window, and upon reaching the scheduled time, the browser will receive the corresponding video and play it.
If you need to implement a video queuing system, you can simply add users to the queue for the video that they want by ID, and then call the next video in the queue using the function for the callback function that starts when the video ends. The callback will query the database for the next video in the queue, retrieve the video and play it.
source share