<%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 $> <%cpp> if (!asyncReq) { <& pageelems.stylesheets &> <& pageelems.ajax_js &> <%cpp> } <%cpp> if (!asyncReq) { <& pageelems.logo &> <& menu active="vlc" &> <%cpp> }
<%cpp> if ( Channel != 0 ) { int streamdevPort = LiveSetup().GetStreamdevPort(); string videourl = string("http://") + request.getServerIp() + ":" + lexical_cast(streamdevPort) + "/" + *Channel->GetChannelID().ToString(); <& vlc.channel_selection &> <%cpp> }
<%include>page_exit.eh <%def channel_selection>