<%pre> #include #include #include #include "setup.h" #include "tools.h" using namespace std; using namespace vdrlive; <%args> tChannelID channel; string async; <%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"); pageTitle = tr("VLC: live video stream"); bool asyncReq = !async.empty() && (lexical_cast(async) != 0); ReadLock channelsLock(Channels); 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?") ); } <& 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> if ( Channel != 0 ) { int streamdevPort = LiveSetup().GetStreamdevPort(); #ifdef TNTVERS7 string server = request.getHost(); server = server.substr(0, server.rfind(':')); #else string server = request.getServerIp(); #endif string videourl = string("http://") + server + ":" + lexical_cast(streamdevPort) + "/" + LiveSetup().GetStreamdevType() + "/" + *Channel->GetChannelID().ToString(); <& 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 $>