dhamaniasad / mythbox

Automatically exported from code.google.com/p/mythbox
GNU General Public License v2.0
0 stars 1 forks source link

Prompt to resume from bookmark location rather than just doing so #221

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am using 1.1.0 and am using streaming. I would like to have the option to 
prompt the user when they choose to play a video with a bookmark like xbmd does.

In xbmc it gives two options:
Resume from X:XX (being the time offset)
start from beginning

I have hacked a xbmcgui yesno Dialog into player.py myself but its not ideal. I 
would prefer to be prompted before I even start playing the video. Would be 
good to have in settings so those who do not want to be prompted would not. 
Alhough no such setting exists in xbmc that I know of.

Even if you could provide some pointers for where to start this I could give it 
a go.  Where do I find xbmc api docs for creating a dialog like the normal xbmc 
one and which py would I put it in. I would need to pass a ignoreBookmarks flag 
into the BookMarker for the onPlaybackStarted.

Original issue reported on code.google.com by jasonmp...@gmail.com on 8 Sep 2012 at 12:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The patch I added does prompt me before playing the video so it probably just 
needs addition of a setting and language vars

Original comment by jasonmp...@gmail.com on 8 Sep 2012 at 2:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
--- player.py.old   2012-09-08 21:30:54.010877593 +1000
+++ player.py   2012-09-09 00:17:06.416515643 +1000
@@ -198,6 +198,16 @@
         mlog.debug('> playRecording %s' % safe_str(self.program.title()))
         assert not self.isPlaying(), 'Player is already playing a video'
         self.commSkipper = commSkipper
+
+   # jpell addition - prompt to start from beginning or from bookmark.
+   bookmarkSecs = self.program.getBookmark()
+        if bookmarkSecs > 0 and bookmarkSecs < (self.program.getDuration() * 
60):
+       question = 'Resume from %s?' % formatSeconds(bookmarkSecs)
+       resume = xbmcgui.Dialog().yesno(self.program.title(),'', 
question,'','Beginning','Resume')
+       
+       if not resume:
+           self.program.setBookmark(0.0)
+
         self.play(self.buildPlaybackUrl(), self.buildPlayList())
         mlog.debug('< playRecording')

Original comment by jasonmp...@gmail.com on 8 Sep 2012 at 2:22