胡斌

1.add readonly input for received movie duration

2.add default parameters for demo ss_start and ds_start
正在显示 1 个修改的文件 包含 39 行增加25 行删除
@@ -137,7 +137,6 @@ a:active { @@ -137,7 +137,6 @@ a:active {
137 137
138 var queryParameters = new Array(); 138 var queryParameters = new Array();
139 var flashVars = ""; 139 var flashVars = "";
140 - var tag = "";  
141 var url = ""; 140 var url = "";
142 var output; 141 var output;
143 var wsState = "idle"; 142 var wsState = "idle";
@@ -316,7 +315,7 @@ a:active { @@ -316,7 +315,7 @@ a:active {
316 info = "framerate:" + uint32params[2] + " duration:" + uint32params[3]; 315 info = "framerate:" + uint32params[2] + " duration:" + uint32params[3];
317 writeToScreen(info); 316 writeToScreen(info);
318 317
319 - document.getElementById("mov_pos").value = parseInt(uint32params[3]); 318 + document.getElementById("duration").value = parseInt(uint32params[3]);
320 319
321 info = "playpos:" + uint32params[4] + " filesize:" + uint32params[5]; 320 info = "playpos:" + uint32params[4] + " filesize:" + uint32params[5];
322 writeToScreen(info); 321 writeToScreen(info);
@@ -661,6 +660,31 @@ a:active { @@ -661,6 +660,31 @@ a:active {
661 pre.innerHTML = message; 660 pre.innerHTML = message;
662 output.appendChild(pre); 661 output.appendChild(pre);
663 } 662 }
  663 +
  664 +function getExplorerTitle() {
  665 + var explorer = window.navigator.userAgent.toLowerCase();
  666 + //ie
  667 + if (explorer.indexOf("msie") >= 0 || explorer.indexOf("trident") >0 ) {
  668 + return "Internet Explorer";
  669 + }
  670 + //firefox
  671 + else if (explorer.indexOf("firefox") >= 0) {
  672 + return "Mozilla Firefox";
  673 + }
  674 + //Chrome
  675 + else if (explorer.indexOf("chrome") >= 0) {
  676 + return "Google Chrome";
  677 + }
  678 + //Opera
  679 + else if (explorer.indexOf("opera") >= 0) {
  680 + return "Opera";
  681 + }
  682 + //Safari
  683 + else if (explorer.indexOf("Safari") >= 0) {
  684 + return "";
  685 + }
  686 + return "";
  687 +}
664 688
665 window.onload = function () 689 window.onload = function ()
666 { 690 {
@@ -669,23 +693,15 @@ a:active { @@ -669,23 +693,15 @@ a:active {
669 document.getElementById( 'websocketURL' ).value = "ws://127.0.0.1:8090"; 693 document.getElementById( 'websocketURL' ).value = "ws://127.0.0.1:8090";
670 694
671 document.getElementById( 'inputURL' ).value = queryParameters['source']; 695 document.getElementById( 'inputURL' ).value = queryParameters['source'];
672 - document.getElementById('embedField').innerHTML = tag;  
673 -  
674 - for(var i=1 ; i<=10;i++)  
675 - {  
676 - var ids = String("sel"+i.toString());  
677 -  
678 - document.getElementById( ids ).style.visibility = "hidden";  
679 - document.getElementById( ids ).className = "style76";  
680 - }  
681 -  
682 - // mark the entry for that index  
683 - if(queryParameters['idx'] != "")  
684 - {  
685 - document.getElementById("td" + queryParameters['idx'] ).className = "style75";  
686 - document.getElementById("sel" + queryParameters['idx'] ).style.visibility = "visible";  
687 - } 696 +
  697 + var default_ss_start_param = "0,0," + window.screen.width + "," + window.screen.height;
  698 + document.getElementById('ss_start_input').value = default_ss_start_param;
  699 +
  700 + var window_name = document.title + " - " + getExplorerTitle();
  701 + document.getElementById('ds_start_window_name').value = window_name;
688 702
  703 + var default_ss_start_pos = "0,0," + window.screen.width + "," + window.screen.height;
  704 + document.getElementById('ds_start_coord').value = default_ss_start_pos;
689 } 705 }
690 706
691 function onJavaScriptBridgeCreated(id){ 707 function onJavaScriptBridgeCreated(id){
@@ -763,10 +779,7 @@ a:active { @@ -763,10 +779,7 @@ a:active {
763 javascriptCallbackFunction: "onJavaScriptBridgeCreated" 779 javascriptCallbackFunction: "onJavaScriptBridgeCreated"
764 }; 780 };
765 781
766 - tag = "&lt;object width='640' height='377' id='StrobeMediaPlayback' name='StrobeMediaPlayback' type='application/x-shockwave-flash' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' &gt;&lt;param name='movie' value='swfs/StrobeMediaPlayback.swf' /&gt; &lt;param name='quality' value='high' /&gt; &lt;param name='bgcolor' value='#000000' /&gt; &lt;param name='allowfullscreen' value='true' /&gt; &lt;param name='flashvars' value= '"+  
767 - flashVars+"'/&gt;&lt;embed src='swfs/StrobeMediaPlayback.swf' width='640' height='377' id='StrobeMediaPlayback' quality='high' bgcolor='#000000' name='StrobeMediaPlayback' allowfullscreen='true' pluginspage='http://www.adobe.com/go/getflashplayer' flashvars='"+ flashVars +"' type='application/x-shockwave-flash'&gt; &lt;/embed&gt;&lt;/object&gt;";  
768 -  
769 - <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 782 + <!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
770 var swfVersionStr = "10.3.0"; 783 var swfVersionStr = "10.3.0";
771 <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. --> 784 <!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
772 var xiSwfUrlStr = "swfs/playerProductInstall.swf"; 785 var xiSwfUrlStr = "swfs/playerProductInstall.swf";
@@ -933,7 +946,7 @@ a:active { @@ -933,7 +946,7 @@ a:active {
933 <tr> 946 <tr>
934 <td width="35" colspan="2"><img src="images/spacer.gif" width="20" height="10" /></td> 947 <td width="35" colspan="2"><img src="images/spacer.gif" width="20" height="10" /></td>
935 <td colspan="3"><button type="button" id="mov_start" onclick="javascript:onTestClick(this);">mov_start</button></td> 948 <td colspan="3"><button type="button" id="mov_start" onclick="javascript:onTestClick(this);">mov_start</button></td>
936 - <td colspan="3"> <button type="button" id="mov_seek" onclick="javascript:onTestClick(this);">mov_seek</button></td> 949 + <td colspan="3"> <button type="button" id="mov_seek" onclick="javascript:onTestClick(this);">mov_seek</button><input id="duration" readonly="readonly" size="10"/></td>
937 <td colspan="3"><button type="button" id="mov_stop" onclick="javascript:onTestClick(this);">mov_stop</button></td> 950 <td colspan="3"><button type="button" id="mov_stop" onclick="javascript:onTestClick(this);">mov_stop</button></td>
938 </tr> 951 </tr>
939 <tr> 952 <tr>
@@ -1057,8 +1070,8 @@ a:active { @@ -1057,8 +1070,8 @@ a:active {
1057 <td width="2%" align="left"><img src="images/spacer.gif" width="10" height="10" /></td> 1070 <td width="2%" align="left"><img src="images/spacer.gif" width="10" height="10" /></td>
1058 <td width="27%" align="left"><a id="connectBtn" onclick="javascript:connectLiveServ();"><img src="images/connect.gif" width="104" height="25" /></a></td> 1071 <td width="27%" align="left"><a id="connectBtn" onclick="javascript:connectLiveServ();"><img src="images/connect.gif" width="104" height="25" /></a></td>
1059 <td align="left">&nbsp;</td> 1072 <td align="left">&nbsp;</td>
1060 - <td width="27%" align="left"><a id="disconnectBtn" onclick="javascript:disconnectLiveServ();"><img src="images/disconnect.gif" width="104" height="25" /> <td align="left">&nbsp;</td>  
1061 - <td align="left">&nbsp;</td> 1073 + <td width="27%" align="left"><a id="disconnectBtn" onclick="javascript:disconnectLiveServ();"><img src="images/disconnect.gif" width="104" height="25" />
  1074 + <td><img src="images/spacer.gif" width="50" height="10" /></td>
1062 <td width="27%" align="left"><a id="clearBtn" onclick="javascript:clearOutput();"><img src="images/clear.gif" width="104" height="25" /></a></td> 1075 <td width="27%" align="left"><a id="clearBtn" onclick="javascript:clearOutput();"><img src="images/clear.gif" width="104" height="25" /></a></td>
1063 </tr> 1076 </tr>
1064 </table></td> 1077 </table></td>
@@ -1071,3 +1084,4 @@ a:active { @@ -1071,3 +1084,4 @@ a:active {
1071 <div id = output /> 1084 <div id = output />
1072 </body> 1085 </body>
1073 </html> 1086 </html>
  1087 +