{=var-set:must_management={=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip=}~1~=}{=if-equal:{=func:get_request_data client_addr=}~{=ini-get:/var/tuxbox/config/Y-Web.conf;management_ip2=}~1~=}=}
{=include-block:Y_Blocks.txt;head_no_charset=}
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<script type="text/javascript" src="/Y_Baselib.js"></script>
<script type="text/javascript" src="/Y_VLC.js"></script>
<script type="text/javascript" src="/Y_Live.js"></script>
<script type="text/javascript">
//<![CDATA[
function build_bouquet_list(bouquet){
	var used_bouquet = bouquet;
	if(used_bouquet == -1)
		used_bouquet = loadSyncURL("/y/cgi?execute=func:get_actual_bouquet_number");
	var bouquet_dropdown_url = "/y/cgi?execute=func:get_bouquets_as_dropdown%20" + used_bouquet + "{=if-empty:{=var-get:must_management=}~~%20true=}";
	var bouquet_dropdown = "<select size=\"1\" class=\"y_live_bouquets\" id=\"bouquets\" onchange=\"change_bouquet()\" title=\"{=L:live.select_bouquet=}\">";
	bouquet_dropdown += loadSyncURL(bouquet_dropdown_url);
	bouquet_dropdown += "<\/select>";
	obj_update('bouquets_div', bouquet_dropdown);
	build_channel_list(used_bouquet, -1);
}
function build_channel_list(bouquet, channel){
	set_controls("disable");
	var used_channel = channel;
	if(used_channel == -1)
		used_channel = loadSyncURL("/y/cgi?execute=func:get_actual_channel_id");
	var channel_dropdown_url = "/y/cgi?execute=func:get_channels_as_dropdown%20" + bouquet;
	channel_dropdown_url  += "%20" + used_channel;
	var channel_dropdown = "<select size=\"1\" class=\"y_live_channels\" id=\"channels\" title=\"{=L:live.select_channel=}\">";
	channel_dropdown += loadSyncURL(channel_dropdown_url);
	channel_dropdown += "</select>";
	obj_update('channels_div', channel_dropdown);
	set_controls("play");
}
function view_epg(){
	var sel=document.x.channels.selectedIndex;
	if(sel != -1){
		channel = document.x.channels[sel].value;
		{=if-equal:{=typ=}~live~
		var f = parent.col2;
		f.location.href = "Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channel;
		~
		window.open("Y_Dyn_Pages.yhtm?page=frame_live_epg&channel="+channel, "epg");
		=}
	}
}
function view_epg_reload(){
	build_bouquet_list(-1);
}
function view_expert_mode(){
	parent.col2.location.href = "/Y_Live_Expert.yhtm?browser={=browser=}&mode={=mode=}&typ={=typ=}";
}
function view_record_mode(){
	parent.col2.location.href = "/Y_Live_Record.yhtm?browser={=browser=}&mode={=mode=}&typ={=typ=}";
}
function view_settings_mode(){
	parent.col2.location.href = "/Y_Settings_Live.yhtm?browser={=browser=}&mode={=mode=}&typ={=typ=}";
}
function view_transcode_mode(){
	parent.col2.location.href = "/Y_Live_Transcode.yhtm?browser={=browser=}&mode={=mode=}&typ=transcode";
}
//]]>
</script>
</head>
<body>
{=var-set:wait_text={=L:live.get_stream_info=}=}{=include-block:Y_Blocks.txt;snip_wait=}
<div id="live_panel">
<form name="x" action="" method="get" style="margin:0;padding:0;">
	<table class="y_live_table" cellspacing="0" cellpadding="0" style="margin:0">
		<tr><td>
			<div id="bouquets_div"><div class="y_live_channels" style="border:1px solid #555555;">
				<img src="/images/smallwait.gif"/> {=L:live.getting_bouquets=}</div>
			</div>
		</td><td>
				{=if-equal:{=typ=}~popup~
				{=if-equal:{=mode=}~tv~
				<select id="resolution" onchange="do_resize()" title="{=L:live.select_resolution=}">
				<option value="1">384x288</option>
				<option value="2">768x576</option>
				<option value="2">960x720</option>
				<option value="4">1152x864</option>
				</select>
			~&nbsp;=}=}
		</td></tr>
		<tr><td>
			<div id="channels_div"><div class="y_live_bouquets" style="border:1px solid #555555;">
				<img src="/images/smallwait.gif"/> {=L:live.getting_channels=}</div>
			</div>
		</td><td>
			<button id="go" class="y_live_button" type="button" title="{=L:live.change_channel=}" onclick="change_channel()" disabled="disabled">
				<img src="/images/play.png"/></button>
			<button id="epg" class="y_live_button" type="button" title="{=L:live.view_epg=}" onclick="view_epg()" disabled="disabled">
				<img src="/images/epg.png"/></button>
			<button id="epg_reload" class="y_live_button" type="button" title="{=L:live.reload=}" onclick="view_epg_reload()">
				<img src="/images/reload.gif"/></button>
		</td></tr>
		<tr id="subsRow" style="display:none">
			<td>
			<div id="subs_div"><div class="y_live_channels" style="border:1px solid #555555;">
				<img src="/images/smallwait.gif"/> {=L:live.getting_subchannels=}</div>
			</div>
			</td><td>
			<button class="y_live_button" type="button" title="{=L:live.change_channel=}" onclick="change_sub_channel()">
				<img src="/images/play.png"/></button>

			</td>
		</tr>
	</table>
</form>
</div>

<div id="vlc_view">
</div>
<div id="live_controls">
	<form name="v" action="" method="get" style="margin:0;padding:0;">
		<button id="PlayOrPause" class="y_live_button" type="button" title="{=L:live.play_or_pause=}"
			onclick="do_play_or_pause()"><img src="/images/pause.png"/></button>
		<button id="stop" type="button" title="{=L:live.stop=}" onclick="do_stop()" class="y_live_button">
			<img src="/images/stop.png"/></button>
		<button id="mute" class="y_live_button" type="button" value="Mute" title="{=L:live.mute=}" onclick="do_mute_toggle()">
			<img src="/images/volumemute.png"/></button>
		<button id="volumedown" class="y_live_button" type="button" value="-" title="{=L:live.lower_volume=}" onclick="V2.set_volume_delta(-10);">
			<img src="/images/volumedown.png"/></button>
		<button id="volumeup" class="y_live_button" type="button" value="+" title="{=L:live.higher_volume=}" onclick="V2.set_volume_delta(+10);">
			<img src="/images/volumeup.png"/></button>
		{=if-equal:{=mode=}~tv~
		<button id="fullscreen" class="y_live_button" type="button" value="F"
			title="{=L:live.fullscreen=}" onclick="V2.toggle_fullscreen()">
			<img src="/images/fullscreen.png"/></button>
		=}
		<button id="livelock" class="y_live_button" type="button" value="Lock" title="{=L:live.lock_unlock=}" name="lock" onclick="do_lock_toggle()">
			<img src="/images/livelock.png"/></button>

		{=if-equal:{=mode=}~tv~
		<button class="y_live_button"  style="visibility:hidden" type="button" value="set" title="{=L:live.toggle_udp=}" id="udp" onclick="do_udp_toggle()">
			<img src="/images/udp_switch_on.png"/></button>
		<button class="y_live_button" type="button" value="set" title="{=L:live.settings=}" id="settings" onclick="view_settings_mode()">
			<img src="/images/properties.png"/></button>
		<button class="y_live_button" type="button" value="S" title="{=L:live.snapshot=}" id="snapshot" onclick="V2.snapshot()"  style="visibility:hidden">
			<img src="/images/snapshot.png"/></button>
		=}
		{=if-equal:{=typ=}~popup~~
		{=if-equal:{=typ=}~transcode~~
		<button id="rec" class="y_live_button" type="button" value="Rec" title="{=L:live.record=}" name="record_mode" onclick="view_record_mode()" style="visibility:hidden">
			<img src="/images/record.png"/></button>
		=}
		<button id="transcode" class="y_live_button" type="button" value="Transcode" title="{=L:live.transcode=}" onclick="view_transcode_mode()" style="visibility:hidden">
			<img src="/images/transcode.png"/></button>
		=}
		<span id="audio_pid_list"></span>
	</form>
</div>
<script type="text/javascript">
//<![CDATA[
	haveUDP = ("{=if-file-exists:/sbin/udpstreamts~true~{=if-file-exists:/var/bin/udpstreamts~true~false=}=}" == "true");
	isUDP = ("{=ini-get:/var/tuxbox/config/Y-Web.conf;udp;false=}" == "true");
	Mode = "{=mode=}";
	LiveTyp = "{=typ=}";
	ClientAddr = "{=func:get_request_data clientaddr=}";
	insert_message_control("{=L:live.build_vlc=}");
	isDeinterlace = ("{=ini-get:/var/tuxbox/config/Y-Web.conf;deinterlace;true=}" == "true");
	cachetime = {=ini-get:/var/tuxbox/config/Y-Web.conf;http_caching;0=};
	Lgetting_channels="{=L:live.getting_channels=}";
	Lgetting_bouquets="{=L:live.getting_bouquets=}";
	
/*	{=if-equal:{=typ=}~popup~
		always_on_top();
	=}
*/
do_onload();
//]]>
</script>

</body>
</html>
