sample.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <html>
  2. <head>
  3. <script src="jstoue.js"></script>
  4. <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
  5. <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
  6. <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  7. </head>
  8. <body style="background-color: transparent; -webkit-user-select: none;">
  9. <p id="fpsMeter">0 FPS</p>
  10. <p id="ue4Text">testString</p>
  11. <p id="ssStr0">0000</p>
  12. <p id="ue4Str">strue4Str</p>
  13. <div id="logo"></div>
  14. <button id="btn_json">json call </button>
  15. <button id="btn_obj">object call </button>
  16. <button id="btn_objp">object call param </button>
  17. <input id="volumeSlider" type="range" min="0.01" max="1" step="0.01" />
  18. <li class="dropdown">
  19. <a class="dropdown-toggle" data-toggle="dropdown" href="#">
  20. Java <span class="caret"></span>
  21. </a>
  22. <ul class="dropdown-menu">
  23. <li><a href="#">Swing</a></li>
  24. <li><a href="#">jMeter</a></li>
  25. <li><a href="#">EJB</a></li>
  26. <li class="divider"></li>
  27. <li><a href="#">·ÖÀëµÄÁ´½Ó</a></li>
  28. </ul>
  29. </li>
  30. </body>
  31. <script>
  32. // response function from ue call
  33. ue.interface.jsfunc = function(jsonObject){
  34. console.log('jsonObject');
  35. alert('popup window');
  36. //console.log(JSON.stringify(jsonObject));
  37. };
  38. ue.interface.multiparams = function(paramStr0,paramStr1){
  39. console.log(paramStr0+'==='+paramStr1);
  40. };
  41. var total = 0;
  42. var response=0;
  43. var btn_json = document.getElementById('btn_json');
  44. btn_json.setAttribute("onclick", "JsonCall()");
  45. var btn_obj = document.getElementById('btn_obj');
  46. btn_obj.setAttribute("onclick", "ObjCall()");
  47. var btn_obj = document.getElementById('btn_objp');
  48. btn_obj.setAttribute("onclick", "ObjCallP()");
  49. // ue.call(key,json,callback,timeout) <==> OnJsEventStr(type,json,callback)
  50. // usage:
  51. // key : string
  52. // json: {"a":1} or [1,2,3,4]
  53. // callback : when success in ue,and ue callback to js
  54. // function(){} or ()=>{}
  55. // timeout: The effective time of the callback function, in seconds
  56. //
  57. function JsonCall() {
  58. //var url = 'rtsp://113.201.104.35:9090/dss/monitor/param?cameraid=1000054%247&substream=1' ;
  59. //alert('qweqwe');
  60. //for (var i=0; i<1000; i++){
  61. total++;
  62. ue.call("videoUrl", { "url": "www.baidu.com", "total": total },
  63. function (jsonObject) {
  64. //alert(rv);
  65. response = response + 1;
  66. console.log("succed " + JSON.stringify(jsonObject) + " " + response);
  67. }
  68. );
  69. //}
  70. }
  71. function ObjCall(){
  72. ue.GetBrowserWnd();
  73. }
  74. function ObjCallP() {
  75. ue.bpbind.help5("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21")
  76. }
  77. </script>
  78. </html>