diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-06-21 19:52:46 +0200 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2008-06-21 19:52:46 +0200 |
commit | 0228a984b44717e7866c126fbe0a2eba68f0a5c3 (patch) | |
tree | 2f1435311bc03eb71a1801c7fc1e197ab22756bf /pages | |
parent | 79f74de951779431ac46535ed1a0c2824a925c4f (diff) | |
download | vdr-plugin-live-0228a984b44717e7866c126fbe0a2eba68f0a5c3.tar.gz vdr-plugin-live-0228a984b44717e7866c126fbe0a2eba68f0a5c3.tar.bz2 |
Use the previous commited functionality to stream recordings.
The recordings now have a stream button beneath them.
Diffstat (limited to 'pages')
-rw-r--r-- | pages/Makefile | 3 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 11 | ||||
-rw-r--r-- | pages/recordings.ecpp | 1 | ||||
-rw-r--r-- | pages/vlc.ecpp | 49 |
4 files changed, 46 insertions, 18 deletions
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 @@ -113,6 +113,17 @@ int update_status(1); <# ---------------------------------------------------------------------- #> +<%def vlc_stream_recording> +<%args> + string recid; + string linkText; +</%args> +<%cpp> { </%cpp><a href="vlc.html?recid=<$ recid $>"><img src="<$ LiveSetup().GetThemedLink("img", "stream_button.png") $>" alt="" <& tooltip.hint text=(tr("Stream this recording into browser.")) &>></img> <$ linkText $></a><%cpp> } </%cpp> +</%def> + + +<# ---------------------------------------------------------------------- #> + <%def event_timer> <%args> string epgid; 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; </%args> <& 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) &> </%def> 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; </%args> <%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<int>(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"); } </%cpp> <& pageelems.doc_type &> @@ -57,7 +64,9 @@ using namespace vdrlive; <script type="text/javascript" src="js/live/vlc.js"></script> <script type="text/javascript"><!-- var vlcControl = new VLC("video1", { - <? !asyncReq ? "autoresize: false" ?> + <? !asyncReq ? "autoresize: false," ?> + <? !Channel ? "playRecording: true," ?> + offset: 5 }); vlcControl.addEvent('toggle', function(id, state){ var text = null; @@ -85,20 +94,26 @@ using namespace vdrlive; } </%cpp> <%cpp> - if ( Channel != 0 ) { - int streamdevPort = LiveSetup().GetStreamdevPort(); -#ifdef TNTVERS7 - string server = request.getHost(); +#if TNTVERSION >= 1606 + string server = request.getHost(); + if (Channel != 0) { server = server.substr(0, server.rfind(':')); + } #else - string server = request.getServerIp(); + string server = request.getServerIp(); #endif - string videourl = string("http://") + server + ":" + lexical_cast<string,int>(streamdevPort) + "/" + LiveSetup().GetStreamdevType() + "/" + *Channel->GetChannelID().ToString(); + string videourl; + if (Channel != 0) { + int streamdevPort = LiveSetup().GetStreamdevPort(); + videourl = string("http://") + server + ":" + lexical_cast<string,int>(streamdevPort) + "/" + LiveSetup().GetStreamdevType() + "/" + *Channel->GetChannelID().ToString(); + } + else { + videourl = string("http://") + server + "/recstream.html?recid=" + recid; + } </%cpp> - <embed type="application/x-vlc-plugin" id="video1" name="video1" autoplay="yes" loop="no" width="720" height="576" target="<$ videourl $>" /> + <embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org/" version="VideoLAN.VLCPlugin.2" id="video1" name="video1" autoplay="yes" loop="no" width="720" height="576" target="<$ videourl $>" /> <& vlc.controls videourl=(videourl) asyncReq=(asyncReq) &> <%cpp> - } if (!asyncReq) { </%cpp> </div> |