np_ocx test.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <HTML>
  2. <HEAD>
  3. <TITLE>MyActiveX</TITLE>
  4. <script type="text/javascript">
  5. function config(){
  6. var obj = document.getElementById("EasyPlayerOcx");
  7. var cache = document.getElementById("cache").value;
  8. var playsound = document.getElementById("playsound").value;
  9. var showtoscale= document.getElementById("showtoscale").value;
  10. var showsatic = document.getElementById("showsatic").value;
  11. obj.Config(cache, playsound, showtoscale, showsatic);
  12. //alert(cache+";"+playsound+";"+showtoscale+";"+showsatic);
  13. }
  14. function startplay(){
  15. var obj = document.getElementById("EasyPlayerOcx");
  16. var url = document.getElementById("url").value;
  17. var rendertype = document.getElementById("rendertype").value;
  18. var name= document.getElementById("name").value;
  19. var password = document.getElementById("password").value;
  20. var hardDecode = document.getElementById("hardwareDecode").value;
  21. obj.Start(url, rendertype, name, password,hardDecode);
  22. config();
  23. //alert(url+";"+rendertype+";"+name+";"+password);
  24. }
  25. function stopplay(){
  26. //alert("Close()!!!!!");
  27. var obj = document.getElementById("EasyPlayerOcx");
  28. obj.Close();
  29. }
  30. </script>
  31. </HEAD>
  32. <BODY>
  33. <center>
  34. MyActiveX Example
  35. <p></p>
  36. <!--
  37. <OBJECT ID="EasyPlayerOcx" WIDTH=100% HEIGHT=100%
  38. CLASSID="CLSID:1EE1C648-F4A9-42F9-9AA7-2C8E3AF7B7FD">
  39. </OBJECT>
  40. -->
  41. <object id="EasyPlayerOcx" ID="EasyPlayerOcx" type="application/x-easyplayerplugin" width="640" height="480">
  42. </object>
  43. 界面信息<br>
  44. RTSP URL:<input type="text" name="url" id="url" VALUE="rtsp://127.0.0.1:554/stream0.sdp"/>
  45. RenderFormat:<input type="text" name="rendertype" id="rendertype" VALUE="0"/>
  46. 用户名:<input type="text" name="name" id="name" size=25 value="admin"/>
  47. 密码:<input type="text" name="password" id="password" size=25 value="admin"/>
  48. 是否使用硬件解码:<input type="text" name="hardwareDecode" id="hardwareDecode" size=25 value="0"/>
  49. <br>
  50. 缓存:<input type="text" name="cache" id="cache" size=25 value ="3"/>
  51. 播放声音:<input type="text" name="playsound" id="playsound" size=25 value ="1"/>
  52. 按比例显示:<input type="text" name="showtoscale" id="showtoscale" size=25 value ="1"/>
  53. 显示码率信息:<input type="text" name="showsatic" id="showsatic" size=25 value ="1"/><br>
  54. <button type="button" onclick="startplay();">Start</button>
  55. <button type="button" onclick="stopplay();">Stop</button>
  56. </center>
  57. </BODY>
  58. </HTML>