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. --- i18n-generated.h | 70 +++++++++++++++++++++++++++++++++++++++++++++ live/js/live/pageenhance.js | 2 +- live/js/live/vlc.js | 53 +++++++++++++++++++++++++--------- pages/Makefile | 3 +- pages/pageelems.ecpp | 11 +++++++ pages/recordings.ecpp | 1 + pages/vlc.ecpp | 49 ++++++++++++++++++++----------- po/ca_ES.po | 6 ++++ po/cs_CZ.po | 6 ++++ po/da_DK.po | 6 ++++ po/de_DE.po | 6 ++++ po/el_GR.po | 6 ++++ po/es_ES.po | 6 ++++ po/et_EE.po | 6 ++++ po/fi_FI.po | 8 ++++++ po/fr_FR.po | 8 ++++++ po/hr_HR.po | 6 ++++ po/hu_HU.po | 6 ++++ po/it_IT.po | 8 ++++++ po/nl_NL.po | 6 ++++ po/nn_NO.po | 6 ++++ po/pl_PL.po | 6 ++++ po/pt_PT.po | 6 ++++ po/ro_RO.po | 6 ++++ po/ru_RU.po | 6 ++++ po/sl_SI.po | 6 ++++ po/sv_SE.po | 6 ++++ po/tr_TR.po | 6 ++++ 28 files changed, 289 insertions(+), 32 deletions(-) diff --git a/i18n-generated.h b/i18n-generated.h index 7fdf27d..fae9fa6 100644 --- a/i18n-generated.h +++ b/i18n-generated.h @@ -5047,6 +5047,41 @@ const tI18nPhrase Phrases[] = { #if VDRVERSNUM >= 10342 "", #endif +#if VDRVERSNUM >= 10502 + "", +#endif + }, + { "Stream this recording into browser.", + "Aufnahme im Browser anzeigen.", + "", + "Trasmetti questo canale nel browser.", + "", + "", + "Diffusez cette chaîne vers le navigateur.", + "", + "Aloita suoratoisto", + "", + "", + "", + "", + "", + "", + "", +#if VDRVERSNUM >= 10302 + "", +#endif +#if VDRVERSNUM >= 10307 + "", +#endif +#if VDRVERSNUM >= 10313 + "", +#endif +#if VDRVERSNUM >= 10316 + "", +#endif +#if VDRVERSNUM >= 10342 + "", +#endif #if VDRVERSNUM >= 10502 "", #endif @@ -8372,6 +8407,41 @@ const tI18nPhrase Phrases[] = { #if VDRVERSNUM >= 10342 "", #endif +#if VDRVERSNUM >= 10502 + "", +#endif + }, + { "VLC: play recording", + "Wiedergabe", + "", + "riproduzione registrazione", + "", + "", + "Lire l'enregistrement", + "", + "Toistetaan tallennetta", + "", + "", + "", + "", + "", + "", + "", +#if VDRVERSNUM >= 10302 + "", +#endif +#if VDRVERSNUM >= 10307 + "", +#endif +#if VDRVERSNUM >= 10313 + "", +#endif +#if VDRVERSNUM >= 10316 + "", +#endif +#if VDRVERSNUM >= 10342 + "", +#endif #if VDRVERSNUM >= 10502 "", #endif 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(); }, diff --git a/pages/Makefile b/pages/Makefile index 1750056..f7512f5 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -16,7 +16,8 @@ OBJS = menu.o recordings.o schedule.o screenshot.o timers.o \ vlc.o searchtimers.o edit_searchtimer.o searchresults.o \ searchepg.o login.o ibox.o xmlresponse.o play_recording.o \ pause_recording.o stop_recording.o ffw_recording.o \ - rwd_recording.o setup.o content.o epginfo.o timerconflicts.o + rwd_recording.o setup.o content.o epginfo.o timerconflicts.o \ + recstream.o ### Default rules: diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index e70d7fd..45d2b7e 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -111,6 +111,17 @@ int update_status(1); +<# ---------------------------------------------------------------------- #> + +<%def vlc_stream_recording> +<%args> + string recid; + string linkText; + +<%cpp> { " alt="" <& tooltip.hint text=(tr("Stream this recording into browser.")) &>> <$ linkText $><%cpp> } + + + <# ---------------------------------------------------------------------- #> <%def event_timer> diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp index 23299bb..fbd29ab 100644 --- a/pages/recordings.ecpp +++ b/pages/recordings.ecpp @@ -171,6 +171,7 @@ for (iter = recordingsTree->begin(path); iter != end; ++iter) { string title; <& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &> +<& pageelems.vlc_stream_recording recid=(id) &> <& pageelems.imdb_info_href title=(title) &> <& recordings.del_rec id=(id) &> diff --git a/pages/vlc.ecpp b/pages/vlc.ecpp index 6245c90..aea5560 100644 --- a/pages/vlc.ecpp +++ b/pages/vlc.ecpp @@ -12,6 +12,7 @@ using namespace vdrlive; <%args> tChannelID channel; string async; + string recid; <%session scope="global"> bool logged_in(false); @@ -23,18 +24,24 @@ using namespace vdrlive; <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); - pageTitle = tr("VLC: live video stream"); - bool asyncReq = !async.empty() && (lexical_cast(async) != 0); - ReadLock channelsLock(Channels); + // the availabilty of Channel signals that we will do live tv streaming. + Channel = 0; + if (recid.empty()) { + pageTitle = tr("VLC: live video stream"); + ReadLock channelsLock(Channels); - if (!channelsLock) { - throw HtmlError(tr("Couldn't aquire access to channels, please try again later.")); + if (!channelsLock) { + throw HtmlError(tr("Couldn't aquire access to channels, please try again later.")); + } + Channel = Channels.GetByChannelID(channel); + if (Channel == 0) { + throw HtmlError( tr("Couldn't find channel or no channels available. Maybe you mistyped your request?") ); + } } - Channel = Channels.GetByChannelID(channel); - if (Channel == 0) { - throw HtmlError( tr("Couldn't find channel or no channels available. Maybe you mistyped your request?") ); + else { + pageTitle = tr("VLC: play recording"); } <& pageelems.doc_type &> @@ -57,7 +64,9 @@ using namespace vdrlive;