From 0228a984b44717e7866c126fbe0a2eba68f0a5c3 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Sat, 21 Jun 2008 19:52:46 +0200 Subject: Use the previous commited functionality to stream recordings. The recordings now have a stream button beneath them. --- live/js/live/pageenhance.js | 2 +- live/js/live/vlc.js | 53 ++++++++++++++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 14 deletions(-) (limited to 'live/js') diff --git a/live/js/live/pageenhance.js b/live/js/live/pageenhance.js index 5ca90c0..dadbab2 100644 --- a/live/js/live/pageenhance.js +++ b/live/js/live/pageenhance.js @@ -12,7 +12,7 @@ var PageEnhance = new Class({ options: { epgLinkSelector: 'a[href^="epginfo.html?epgid"]', actionLinkSelector: 'a[href^="vdr_request/"]', - vlcLinkSelector: 'a[href^="vlc.html?channel"]', + vlcLinkSelector: 'a[href^="vlc.html?"]', vlcWinOptions: { size: { width: 720, height: 640 } }, diff --git a/live/js/live/vlc.js b/live/js/live/vlc.js index 13ee77c..927f3a4 100644 --- a/live/js/live/vlc.js +++ b/live/js/live/vlc.js @@ -54,7 +54,8 @@ var VLC = new Class({ id: "Close", classes: { on: "yellow", off: "yellow" }}, ], - offset: 5 + offset: 5, + playRecording: false }, initialize: function(id, options){ @@ -65,6 +66,11 @@ var VLC = new Class({ playerSetup: function(){ this.vlc = $(this.id); + this.newVlcApi = (this.vlc.VersionInfo != null); + if (this.newVlcApi) { + // disable logging. + this.vlc.log.verbosity = -1; + } // add here new actions these class might support: var actions = { play: { check: this.isPlaying, toggle: this.togglePlay }, @@ -104,32 +110,53 @@ var VLC = new Class({ }, isPlaying: function(){ - // return this.vlc.playlist && this.vlc.playlist.isPlaying; - return this.vlc.isplaying(); + if (this.newVlcApi) + return this.vlc.playlist && this.vlc.playlist.isPlaying; + else + return this.vlc.isplaying(); }, isMuted: function(){ - // return this.vlc.audio && this.vlc.audio.mute; - var res = this.vlc.get_volume(); - return 0 == res; + if (this.newVlcApi) + return this.vlc.audio && this.vlc.audio.mute; + else { + var res = this.vlc.get_volume(); + return 0 == res; + } }, togglePlay: function(){ - // this.vlc.playlist.togglePause(); - if (this.isPlaying()) - this.vlc.stop(); - else - this.vlc.play(); + if (this.newVlcApi) + if (!this.options.playRecording) + this.vlc.playlist.togglePause(); + else { + if (this.vlc.playlist.isPlaying) + this.vlc.playlist.stop(); + else + this.vlc.playlist.play(); + } + else { + if (this.isPlaying()) + this.vlc.stop(); + else + this.vlc.play(); + } this.setStates(); }, toggleMute: function(){ - this.vlc.mute(); + if (this.newVlcApi) + this.vlc.audio.toggleMute(); + else + this.vlc.mute(); this.setStates(); }, toggleScreen: function(){ - this.vlc.fullscreen(); + if (this.newVlcApi) + this.vlc.video.toggleFullscreen(); + else + this.vlc.fullscreen(); this.setStates(); }, -- cgit v1.2.3