<%pre> #include #include #include using namespace std; using namespace vdrlive; <%args> tChannelID channel; string async; string recid; <%session scope="global"> bool logged_in(false); <%request scope="page"> cChannel* Channel; <%include>page_init.eh <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); if (!cUser::CurrentUserHasRightTo(UR_STARTREPLAY)) throw HtmlError( tr("Sorry, no permission. Please contact your administrator!") ); bool asyncReq = !async.empty() && (lexical_cast(async) != 0); // the availabilty of Channel signals that we will do live tv streaming. Channel = 0; if (recid.empty()) { pageTitle = tr("VLC: live video stream"); #if VDRVERSNUM >= 20301 LOCK_CHANNELS_READ; Channel = (cChannel *)Channels->GetByChannelID(channel); #else ReadLock channelsLock(Channels); if (!channelsLock) { throw HtmlError(tr("Couldn't aquire access to channels, please try again later.")); } Channel = Channels.GetByChannelID(channel); #endif 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 &> VDR-Live - <$ pageTitle $> <& pageelems.stylesheets &> <%cpp> if (!asyncReq) { <& pageelems.ajax_js &> <%cpp> } else { <%cpp> } <%cpp> if (!asyncReq) { <& pageelems.logo &> <& menu active="vlc" &>
<%cpp> } <%cpp> string server = request.getHost(); server = server.substr(0, server.rfind(':')); string videourl; if (Channel != 0) { int streamdevPort = LiveSetup().GetStreamdevPort(); videourl = string("http://") + server + ":" + lexical_cast(streamdevPort) + "/" + LiveSetup().GetStreamdevType() + "/" + *Channel->GetChannelID().ToString(); } else { videourl = string("http://") + server + ":" + lexical_cast(LiveSetup().GetServerPort()) + "/recstream.html?recid=" + recid; } <& vlc.controls videourl=(videourl) asyncReq=(asyncReq) &> <%cpp> if (!asyncReq) {
<%cpp> } <%include>page_exit.eh <%def controls> <%args> string videourl; bool asyncReq;
<%cpp> if (asyncReq) { <%cpp> }

<$ tr("VLC media URL") $>: <$ videourl $>