NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 2 3 4 5 6 … 93 Next »
Resuming a video

 
  • 0 Vote(s) - 0 Average
Resuming a video
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#1
2011-04-24, 12:52 PM
The following "seems" to work:

Code:
Int32 duration = new Int32();
int position = PlaybackPositionHelper.GetPlaybackPosition(path, out duration);

PluginHelperFactory.GetPluginHelper().PlayVideoFile(path);

IPlaybackProxy proxy = PluginHelperFactory.GetPluginHelper().GetPlaybackProxy();
proxy.SetPosition(position);

But like most code pulled from the innards of an API I don't really understand, I'd like to know if it's ok?

Thanks

Iain
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#2
2011-04-24, 07:19 PM
Yep, that should be ok. From memory the Video Library does the same thing.
imilne
Offline

Posting Freak

Posts: 2,423
Threads: 135
Joined: Feb 2008
#3
2011-04-24, 07:48 PM
sub Wrote:Yep, that should be ok.
Excellent, thanks.

sub Wrote:From memory the Video Library does the same thing.
That's pretty much how I worked it out. A combination of browsing the API and looking at the log messages produced by the Video Library. That's what gave the clue to setting the resume position *after* starting the video :confused:

Iain
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#4
2015-09-22, 09:58 PM
I can't find PlaybackPositionHelper in the NPVR API. Is there something else in the API now that we can use to get this information for a plugin or do we have to read the database directly? Thanks.
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#5
2015-09-22, 10:01 PM
PlaybackPositionHelper is still there. It was never really intended to be part of the public api, but you can use it by adding a reference to NShared.dll.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,124
Threads: 957
Joined: May 2006
#6
2015-09-22, 11:12 PM
sub Wrote:PlaybackPositionHelper is still there. It was never really intended to be part of the public api, but you can use it by adding a reference to NShared.dll.

Here is how I use it in iGL if the file is renamed and it was played in-progress

Code:
if (File.Exists(source) == false && destTS != null)
                    {
                        int duration = -1;
                        int position = PlaybackPositionHelper.GetPlaybackPosition(source, out duration);
                        if (duration > 0)
                        {
                            PlaybackPositionHelper.StorePlaybackPosition(destTS, position, duration);
                            PlaybackPositionHelper.DeletePlaybackPosition(source);
                        }

The trick for me was not using the return code.

Martin
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#7
2015-09-23, 08:32 PM
IPlaybackProxy.SetPosition(); works fine in my plugin when running in NPVR, however, it doesn't work and seems to stop playback when running my plugin in the XNEWA web client. Is there another way to set the playback position in this case? Thanks.
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#8
2015-09-23, 08:35 PM
Unfortunately playback via the webclient isn't managed by NextPVR. That is done directly by the client, and not something NextPVR has any control over. The IPlaybackProxy wont be usable there.
cncb
Offline

Senior Member

Posts: 729
Threads: 112
Joined: Aug 2011
#9
2015-09-23, 09:12 PM
Resume from the Recordings list popup works from the web client so is it using something special?
My Plugins: PhotoFilter, MusicMonkey, Windows Desktop Gadget
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#10
2015-09-23, 09:23 PM
When you play a video file using the webclient, the web server passes an activity to the client effectively saying "play file x". When you do a resume, it does the same thing, but instead it passes a more detailed activity "play file x from position t". We still have no control over the video when it's playing, or no idea where it's up to, but you can get it to start playback from a particular location.

You can trigger the same thing from a plugin using:
Code:
Hashtable resumeMetaData = new Hashtable();
                            resumeMetaData["RESUME_FROM"] = position;
                            PluginHelperFactory.GetPluginHelper().PlayVideoFile(filename, resumeMetaData);
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Video streaming URL and parameters? cncb 1 1,929 2021-10-22, 06:58 PM
Last Post: sub
  Extras device - using hardware video encoder gdogg371 6 3,383 2021-03-09, 12:18 AM
Last Post: gdogg371
  Loading Local Video Files Syler 25 6,956 2021-03-07, 09:20 PM
Last Post: Syler
  How to tell when video playback has finished in web client? cncb 6 4,383 2015-09-29, 08:07 PM
Last Post: cncb
  VIdeo playback from plugin mvallevand 5 3,621 2015-08-06, 10:43 PM
Last Post: sub
  Inset Video - Stop mvallevand 2 2,129 2013-08-07, 09:57 PM
Last Post: mvallevand
  Video Library Fanart Transparency tieke 7 4,040 2013-01-09, 08:23 AM
Last Post: tieke
  NMT Video Playback - does it receive start/stop events psycik 8 3,535 2012-07-15, 10:01 PM
Last Post: mvallevand
  Resume or Restart dialog for video psycik 6 3,136 2011-12-22, 02:52 AM
Last Post: mvallevand
  sample video overlay plugin source code? reven 2 2,434 2011-10-03, 12:42 AM
Last Post: reven

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

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

Linear Mode
Threaded Mode