Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script language="JavaScript" type="text/javascript">
- var id_pos = location.href.search("id");
- var chnr_pos = location.href.search("all");
- var chsel_pos = location.href.search("sel");
- var pal_pos = location.href.search("pal");
- var thd_id = location.href.substring(id_pos+3, chnr_pos-1);
- var ch_nr = location.href.substring(chnr_pos+4, chsel_pos-1);
- var ch_sel = location.href.substring(chsel_pos+4, pal_pos-1);
- var b_pal = location.href.substring(pal_pos+4);
- var pic_cnt = 1;
- var time_past = 0;
- var bImgLoaded = 0;
- var img_idx = 0;
- var prev_time = 0;
- live_date = new Date();
- img_buf = new Array(new Image(), new Image());
- ajax_req = new XMLHttpRequest();
- function ImageLoaded()
- {
- bImgLoaded = 1;
- }
- function ChgChannel()
- {
- document.form1.THREAD_ID.value = thd_id;
- document.form1.submit();
- }
- /*
- window.onunload=function()
- {
- document.form2.THREAD_ID.value = thd_id;
- document.form2.submit();
- }
- */
- img_buf[0].onload = ImageLoaded;
- img_buf[0].onabort = ImageLoaded;
- img_buf[0].onerror = ImageLoaded;
- img_buf[1].onload = ImageLoaded;
- img_buf[1].onabort = ImageLoaded;
- img_buf[1].onerror = ImageLoaded;
- img_buf[0].src = "ivop.get?action=live&piccnt=0&THREAD_ID=" + thd_id;
- </script>
- </head>
- <body>
- <div align="center">
- <table width="200" style="height: 36px">
- <tr>
- <td width="125" scope="col"><form action="showch.set" method="get" name="form1">
- <select name="channel" id="channel" onChange="ChgChannel()">
- <option value="1">CH1</option>
- <option value="2">CH2</option>
- <option value="3">CH3</option>
- <option value="4">CH4</option>
- <option value="5">CH5</option>
- <option value="6">CH6</option>
- <option value="7">CH7</option>
- <option value="8">CH8</option>
- <option value="9">CH9</option>
- <option value="10">CH10</option>
- <option value="11">CH11</option>
- <option value="12">CH12</option>
- <option value="13">CH13/option>
- <option value="14">CH14</option>
- <option value="15">CH15</option>
- <option value="16">CH16</option>
- </select>
- <input name="THREAD_ID" type="hidden">
- </form> </td>
- <td width="150" scope="col"> </td>
- <th width="61" scope="col"><form name="form2" method="get" action="Forcekick.set" >
- <div align="right">
- <input name="ITSELF" type="hidden" value="1">
- <input name="THREAD_ID" type="hidden">
- <input name="Logout" type="submit" value="Logout"
- onClick="document.form2.THREAD_ID.value = thd_id">
- </div>
- </form> </th>
- </tr>
- </table>
- <hr>
- <form name="form3" method="get" action="">
- <input name="livetime" type="text" id="livetime" size="28" readonly="true" style="border:none">
- </form>
- <p><img name="liveview" id="liveview" width="352" height="240" border="1" alt="Live View"></p>
- </div>
- <script>
- function RefreshLiveView()
- {
- //
- // pic_cnt is just to avoid caching in some browser, like Firefox
- // URL to get live video: "ivop.get?action=live&piccnt=" + pic_cnt + "&THREAD_ID=" + thd_id
- //
- time_past++;
- if (bImgLoaded || time_past>5)
- {
- bImgLoaded = 0;
- time_past = 0;
- document.liveview.src = img_buf[img_idx].src;
- img_idx ^= 1; // next one
- img_buf[img_idx].src = "ivop.get?action=live&piccnt=" + pic_cnt + "&THREAD_ID=" + thd_id;
- pic_cnt++;
- }
- setTimeout("RefreshLiveView()", 1000);
- }
- function UpdateContents()
- {
- for (opt=document.form1.channel.length; opt>0; opt--)
- {
- if (opt>ch_nr)
- document.form1.channel.options[opt-1].text = "N.A.";
- }
- document.form1.channel.selectedIndex = ch_sel - 1;
- document.form1.channel.length = ch_nr;
- if (b_pal==1)
- document.liveview.height = 288;
- }
- function RefreshLiveTime()
- {
- ajax_req.open("GET", "livetime.get?THREAD_ID="+thd_id, false);
- ajax_req.send(null);
- if (ajax_req.responseText>0 && prev_time!=ajax_req.responseText)
- {
- prev_time = ajax_req.responseText;
- live_date.setTime(prev_time*1000);
- document.form3.livetime.size = live_date.toLocaleString().length + 2;
- document.form3.livetime.value = live_date.toLocaleString();
- }
- setTimeout("RefreshLiveTime()", 500);
- }
- UpdateContents();
- RefreshLiveView();
- RefreshLiveTime();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement