胡斌

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 {
var queryParameters = new Array();
var flashVars = "";
var tag = "";
var url = "";
var output;
var wsState = "idle";
... ... @@ -316,7 +315,7 @@ a:active {
info = "framerate:" + uint32params[2] + " duration:" + uint32params[3];
writeToScreen(info);
document.getElementById("mov_pos").value = parseInt(uint32params[3]);
document.getElementById("duration").value = parseInt(uint32params[3]);
info = "playpos:" + uint32params[4] + " filesize:" + uint32params[5];
writeToScreen(info);
... ... @@ -661,6 +660,31 @@ a:active {
pre.innerHTML = message;
output.appendChild(pre);
}
function getExplorerTitle() {
var explorer = window.navigator.userAgent.toLowerCase();
//ie
if (explorer.indexOf("msie") >= 0 || explorer.indexOf("trident") >0 ) {
return "Internet Explorer";
}
//firefox
else if (explorer.indexOf("firefox") >= 0) {
return "Mozilla Firefox";
}
//Chrome
else if (explorer.indexOf("chrome") >= 0) {
return "Google Chrome";
}
//Opera
else if (explorer.indexOf("opera") >= 0) {
return "Opera";
}
//Safari
else if (explorer.indexOf("Safari") >= 0) {
return "";
}
return "";
}
window.onload = function ()
{
... ... @@ -669,23 +693,15 @@ a:active {
document.getElementById( 'websocketURL' ).value = "ws://127.0.0.1:8090";
document.getElementById( 'inputURL' ).value = queryParameters['source'];
document.getElementById('embedField').innerHTML = tag;
for(var i=1 ; i<=10;i++)
{
var ids = String("sel"+i.toString());
document.getElementById( ids ).style.visibility = "hidden";
document.getElementById( ids ).className = "style76";
}
// mark the entry for that index
if(queryParameters['idx'] != "")
{
document.getElementById("td" + queryParameters['idx'] ).className = "style75";
document.getElementById("sel" + queryParameters['idx'] ).style.visibility = "visible";
}
var default_ss_start_param = "0,0," + window.screen.width + "," + window.screen.height;
document.getElementById('ss_start_input').value = default_ss_start_param;
var window_name = document.title + " - " + getExplorerTitle();
document.getElementById('ds_start_window_name').value = window_name;
var default_ss_start_pos = "0,0," + window.screen.width + "," + window.screen.height;
document.getElementById('ds_start_coord').value = default_ss_start_pos;
}
function onJavaScriptBridgeCreated(id){
... ... @@ -763,10 +779,7 @@ a:active {
javascriptCallbackFunction: "onJavaScriptBridgeCreated"
};
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= '"+
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;";
<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. -->
var swfVersionStr = "10.3.0";
<!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
var xiSwfUrlStr = "swfs/playerProductInstall.swf";
... ... @@ -933,7 +946,7 @@ a:active {
<tr>
<td width="35" colspan="2"><img src="images/spacer.gif" width="20" height="10" /></td>
<td colspan="3"><button type="button" id="mov_start" onclick="javascript:onTestClick(this);">mov_start</button></td>
<td colspan="3"> <button type="button" id="mov_seek" onclick="javascript:onTestClick(this);">mov_seek</button></td>
<td colspan="3"> <button type="button" id="mov_seek" onclick="javascript:onTestClick(this);">mov_seek</button><input id="duration" readonly="readonly" size="10"/></td>
<td colspan="3"><button type="button" id="mov_stop" onclick="javascript:onTestClick(this);">mov_stop</button></td>
</tr>
<tr>
... ... @@ -1057,8 +1070,8 @@ a:active {
<td width="2%" align="left"><img src="images/spacer.gif" width="10" height="10" /></td>
<td width="27%" align="left"><a id="connectBtn" onclick="javascript:connectLiveServ();"><img src="images/connect.gif" width="104" height="25" /></a></td>
<td align="left">&nbsp;</td>
<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>
<td align="left">&nbsp;</td>
<td width="27%" align="left"><a id="disconnectBtn" onclick="javascript:disconnectLiveServ();"><img src="images/disconnect.gif" width="104" height="25" />
<td><img src="images/spacer.gif" width="50" height="10" /></td>
<td width="27%" align="left"><a id="clearBtn" onclick="javascript:clearOutput();"><img src="images/clear.gif" width="104" height="25" /></a></td>
</tr>
</table></td>
... ... @@ -1071,3 +1084,4 @@ a:active {
<div id = output />
</body>
</html>
... ...