NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 72 73 74 75 76 … 93 Next »
Video Playback Queue

 
  • 0 Vote(s) - 0 Average
Video Playback Queue
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#1
2005-04-08, 03:04 AM
One feature I would love to see is a Video Play queue implemented. Subs given us some events that GBPVR currently executes:

CurrentAudioTrack,
CurrentVideoTrack,
CurrentChannelNumber,
CurrentChannelName,
VideoStopping,
MusicStopping,

What would be nice is a helper plugin that all it does is listens and reacts to events. It would even toss it own events that other plugins could listen for and react too. Here is the general idea:

Video Queue helper Events:
Listens for:
AddVideoToQuee
VideoStopping
CurrentVideo
ListVideosInQueue
DeleteFromQueue
ClearQueue
RetrieveNextVideo

Fires off:
NextVideoInQueue
VideosInQueue
DeletedFromQueue
ClearedQueue

Basically this is how it works, and we'll use My Videos just as an example.

1. My Videos has a play list of Videos that it wants to play. Say a Intro, three trailers, and then the main video.
2. It adds these files each to the VideoQueue by executing an AddVideoToQueue event for each of these videos.
3. Once this is complete, it fires an event for RetrieveNextVideo and the VideoQueue plugin excutes a NextVideoInQueue event, which My Videos would listen for.
4. Once it has retrieved the next video in queue, it would take the filename and start the GBPVR playing the video.
5. The StoppingVideo event is fired when the playback is complete, and the entry is deleted from the queue.
6. My Videos detects that playback was stopped either by finishing the video or the user has stopped it themselves. If the video has finished, it requests the next video in the queue, and then plays the next video.

The above should work in theory, but I'm not overly familiar with eventing as I typically do most of my programming at the business layer and don't have to deal much with events. Can anybody that is more familiar with this poke holes in this and also provide possible band aids.
capone
Offline

Posting Freak

Posts: 1,756
Threads: 190
Joined: Jan 2005
#2
2005-04-08, 03:22 AM
Wouldn't this just be a different use of the priority system for the most part? Same concept: putting a list of media in order to play, instead of record?

Just thinking an existing plugin could be expanded/reporposed possibly to save some dev brain time.
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#3
2005-04-08, 04:07 AM
Not really. Similar concepts but not implemented the same way and serve different purposes. The Priority recording system, just schedules, and doesn't do anything with events. It's really more of an external utility instead of a plugin (even though XRecord uses one of it's public interfaces).

The Video Playback Queue would be a true plugin in that it would implement the plugin interface, but run in the background like the LCD plugin does. It's sole purpose would be to listen for events and respond appropriately. Acting as a traffic cop for video playback.
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#4
2005-04-08, 04:46 AM
what if a queue exists, but a user pushes stop, the "videostop" event is fired, and the next video will play, if the video queue is huge (eg 100) and you push stop on video number 2, you would have to go through the entire queue (this is why i gave up on doing this myself, i want queues for music videos, which means large playlists).
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#5
2005-04-08, 03:11 PM
Well, in that case we need to be able to identify how the video was stopped. Is there a way to detect once the video is playing what key was pressed. If the CTRL+S key was pressed, then this means it stopped due to the user stopping it, and some sort of screen would need to come up to ask if they wanted to continue or delete the queue. IF they wanted to delete the queue, a DeleteQueue event would be executed to delete the queue.

Do the plugins have any control of the keyboard once the playing of a video starts?
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#6
2005-04-08, 11:19 PM
nope, no control here. if the video finishes or if the user presses stop, the same event is fired. i think this is best left up to sub, it shouldnt be to hard for him to implement, we just have to wait.
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#7
2005-04-09, 02:05 AM (This post was last modified: 2005-04-09, 02:14 AM by KingArgyle.)
Yeah, but it'll give me something to play with in the mean time. Smile

I think it should be possible to have the plugin monitor different events, so that when a KeyPress event occurs that it captures that keypress and stores it. Then when the StoppingVideo event occurs it could check to see what the last key press was and then respond accordingly.

Only true way to see if it works is basically have a event monitoring plugin that logs the various events and when they occur. If I get sometime I may take a stab at this plugin. It'll be a good learning experience if nothing else.
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#8
2005-04-10, 05:06 AM (This post was last modified: 2005-04-10, 05:22 AM by KingArgyle.)
Reven....I can now detect when a user hits CTRL + S when a video is playing. Smile

Basically, I created a small test plugin that monitors the Windows Message Queue and checks the keyboard state to see if the CTRL key was pressed. If so it then checks to see if the 'S' was pressed. If it is, I write a message to the log, the following is the output:

Code:
4/10/2005 12:52:51 AM.615    INFO    [2]    playFile()
4/10/2005 12:52:51 AM.615    INFO    [2]    Found commercial skip point file: c:\shared folder\archived_videos\quantum leap\killin' time_ june 18, 1961.avi
4/10/2005 12:52:51 AM.615    ERROR    [2]    Unexpected error parsing commercial skip point file
4/10/2005 12:52:51 AM.615    VERBOSE    [2]    Initialized Key Monitor
4/10/2005 12:52:51 AM.925    VERBOSE    [2]    About to play file: C:\Shared Folder\Archived_Videos\Quantum Leap\Killin' Time_ June 18, 1961.avi
4/10/2005 12:52:53 AM.597    VERBOSE    [2]    Playback started: C:\Shared Folder\Archived_Videos\Quantum Leap\Killin' Time_ June 18, 1961.avi
4/10/2005 12:52:54 AM.238    VERBOSE    [2]    Received event code: 11
4/10/2005 12:52:54 AM.238    VERBOSE    [2]    Received event code: 0
4/10/2005 12:52:54 AM.268    VERBOSE    [2]    Checking if resume prompt needs to be shown
4/10/2005 12:53:27 AM.957    VERBOSE    [2]    Queue Monitor: Stop Command Detected.S
4/10/2005 12:53:27 AM.967    VERBOSE    [2]    PlaybackPositionManager.storeLastPlaybackPosition(C:\Shared Folder\Archived_Videos\Quantum Leap\Killin' Time_ June 18, 1961.avi, 34)
4/10/2005 12:53:28 AM.568    VERBOSE    [2]    Queue Monitor: Stop Command Detected.S

The plugin implements the IEventNotification class and the Notify method. It checks a switch to see if it needs to add the MessageFilter to the Application filters, if it does, it adds a custom MessageFilter method, and does nothing else. When it initiliazes the filter, it writes a message to log in this case "Initialized Key Monitor".

Now when ever a Windows Message is fired, the custom Message Filter will check the keyboard and look for the CTRL + S combination. If it finds it is writes out a message to the log "Queue Monitor: Stop Command Detected." and the Char that is stored in the WParm.

Anyway, now that we can identify when the user stops the playback we have to decide whether to implement the queue or just let plugins handle the key capturing themselves.
KingArgyle
Offline

Posting Freak

Posts: 1,271
Threads: 95
Joined: Nov 2004
#9
2005-04-17, 10:38 PM
With BleepBloop out of the way as the proof of concept, I'll probably take a crack at this. Basically, I'm looking for a couple of items from the various video plugin developers.

1. If I handle everything by events, will this get you what you need in order to use a queue for playback.

2. What features in the queue do you require.

My time is limited but I've got the hard part figured out (detecting key strokes when the plugin doesn't have focus), the rest is just windows event programming.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Video streaming URL and parameters? cncb 1 1,780 2021-10-22, 06:58 PM
Last Post: sub
  Extras device - using hardware video encoder gdogg371 6 3,194 2021-03-09, 12:18 AM
Last Post: gdogg371
  Loading Local Video Files Syler 25 6,408 2021-03-07, 09:20 PM
Last Post: Syler
  Resuming a video imilne 28 14,416 2016-10-30, 09:27 PM
Last Post: mvallevand
  How to tell when video playback has finished in web client? cncb 6 4,214 2015-09-29, 08:07 PM
Last Post: cncb
  VIdeo playback from plugin mvallevand 5 3,432 2015-08-06, 10:43 PM
Last Post: sub
  Inset Video - Stop mvallevand 2 2,065 2013-08-07, 09:57 PM
Last Post: mvallevand
  Video Library Fanart Transparency tieke 7 3,869 2013-01-09, 08:23 AM
Last Post: tieke
  NMT Video Playback - does it receive start/stop events psycik 8 3,367 2012-07-15, 10:01 PM
Last Post: mvallevand
  Resume or Restart dialog for video psycik 6 2,979 2011-12-22, 02:52 AM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode