ezuikit-js 7.7.2 → 7.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/CHANGELOG.md +101 -115
  2. package/README.md +474 -490
  3. package/demos/EZUIKitHD/EZUIKitHD.html +171 -0
  4. package/demos/EZUIKitHD/js/jsWebControl-1.0.0.min.js +80 -0
  5. package/demos/base-demo/base.html +118 -0
  6. package/demos/base-demo/ezuikit.js +1848 -0
  7. package/demos/base-demo/ezuikit_static/v65/v1/css/component.css +1257 -0
  8. package/demos/base-demo/ezuikit_static/v65/v1/css/inspectTheme.css +352 -0
  9. package/demos/base-demo/ezuikit_static/v65/v1/css/theme.css +104 -0
  10. package/demos/base-demo/ezuikit_static/v65/v1/imgs/bg.png +0 -0
  11. package/demos/base-demo/ezuikit_static/v65/v1/imgs/bg.svg +33 -0
  12. package/demos/base-demo/ezuikit_static/v65/v1/imgs/empty.png +0 -0
  13. package/demos/base-demo/ezuikit_static/v65/v1/imgs/end.png +0 -0
  14. package/demos/base-demo/ezuikit_static/v65/v1/imgs/fallback.svg +52 -0
  15. package/demos/base-demo/ezuikit_static/v65/v1/imgs/start.png +0 -0
  16. package/demos/base-demo/ezuikit_static/v65/v1/js/AudioRenderer.js +225 -0
  17. package/demos/base-demo/ezuikit_static/v65/v1/js/SuperRender_10.js +397 -0
  18. package/demos/base-demo/ezuikit_static/v65/v1/js/SystemTransform.js +22 -0
  19. package/demos/base-demo/ezuikit_static/v65/v1/js/SystemTransform.js.mem +0 -0
  20. package/demos/base-demo/ezuikit_static/v65/v1/js/jsPluginV1-1.0.0.min.js +12 -0
  21. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/AudioRenderer.js +225 -0
  22. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/DecodeWorker.js +616 -0
  23. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/DecodeWorkerString.js +616 -0
  24. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/Decoder.js +1 -0
  25. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/JSPlaySDKInterface.js +2139 -0
  26. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/SuperRender_10.js +397 -0
  27. package/demos/base-demo/ezuikit_static/v65/v1/js/playctrl/SuperRender_20.js +1 -0
  28. package/demos/base-demo/ezuikit_static/v65/v1/js/transform/SystemTransform.js +22 -0
  29. package/demos/base-demo/ezuikit_static/v65/v1/js/transform/SystemTransform.js.mem +0 -0
  30. package/demos/base-demo/ezuikit_static/v65/v1/js/transform/systemTransform-worker.min.js +1 -0
  31. package/demos/base-demo/ezuikit_static/v65/v1/js/tts-v4.js +346 -0
  32. package/demos/base-demo/ezuikit_static/v65/v1/rec/datepicker.js +1522 -0
  33. package/demos/base-demo/ezuikit_static/v65/v1/rec/datepicker.min.css +36 -0
  34. package/demos/base-demo/ezuikit_static/v65/v1/rec/datepicker.zh-CN.js +19 -0
  35. package/demos/base-demo/ezuikit_static/v65/v1/rec/jquery.min.js +2 -0
  36. package/demos/base-demo/ezuikit_static/v65/v1/speed/speed.css +145 -0
  37. package/demos/base-demo/ezuikit_static/v65/v1/talk/adapeter.js +5497 -0
  38. package/demos/base-demo/ezuikit_static/v65/v1/talk/janus.js +3507 -0
  39. package/demos/base-demo/ezuikit_static/v65/v1/talk/tts-v4.js +346 -0
  40. package/demos/base-demo/ezuikit_static/v65/v3/css/component.css +1257 -0
  41. package/demos/base-demo/ezuikit_static/v65/v3/css/inspectTheme.css +352 -0
  42. package/demos/base-demo/ezuikit_static/v65/v3/css/theme.css +105 -0
  43. package/demos/base-demo/ezuikit_static/v65/v3/imgs/bg.png +0 -0
  44. package/demos/base-demo/ezuikit_static/v65/v3/imgs/bg.svg +33 -0
  45. package/demos/base-demo/ezuikit_static/v65/v3/imgs/empty.png +0 -0
  46. package/demos/base-demo/ezuikit_static/v65/v3/imgs/end.png +0 -0
  47. package/demos/base-demo/ezuikit_static/v65/v3/imgs/fallback.svg +52 -0
  48. package/demos/base-demo/ezuikit_static/v65/v3/imgs/start.png +0 -0
  49. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/Decoder.js +21 -0
  50. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/Decoder.wasm +0 -0
  51. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/Decoder.worker.js +1 -0
  52. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/HasSIMD/Decoder.js +21 -0
  53. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/HasSIMD/Decoder.wasm +0 -0
  54. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/HasSIMD/Decoder.worker.js +1 -0
  55. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/NoSIMD/Decoder.js +21 -0
  56. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/NoSIMD/Decoder.wasm +0 -0
  57. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/NoSIMD/Decoder.worker.js +1 -0
  58. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/noWorker/Decoder.js +21 -0
  59. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/noWorker/Decoder.wasm +0 -0
  60. package/demos/base-demo/ezuikit_static/v65/v3/js/PlayCtrlWasm/noWorker/Decoder.worker.js +1 -0
  61. package/demos/base-demo/ezuikit_static/v65/v3/js/jsPluginV3-1.0.0.min.js +16543 -0
  62. package/demos/base-demo/ezuikit_static/v65/v3/js/wasmplayer.min.js +1 -0
  63. package/demos/base-demo/ezuikit_static/v65/v3/rec/datepicker.js +1522 -0
  64. package/demos/base-demo/ezuikit_static/v65/v3/rec/datepicker.min.css +36 -0
  65. package/demos/base-demo/ezuikit_static/v65/v3/rec/datepicker.zh-CN.js +19 -0
  66. package/demos/base-demo/ezuikit_static/v65/v3/rec/jquery.min.js +2 -0
  67. package/demos/base-demo/ezuikit_static/v65/v3/speed/speed.css +145 -0
  68. package/demos/base-demo/ezuikit_static/v65/v3/talk/adapeter.js +5497 -0
  69. package/demos/base-demo/ezuikit_static/v65/v3/talk/janus.js +3507 -0
  70. package/demos/base-demo/ezuikit_static/v65/v3/talk/tts-v4.js +343 -0
  71. package/demos/base-demo/hls.html +24 -0
  72. package/demos/base-demo/index.html +117 -0
  73. package/demos/base-demo/localDecoder.html +118 -0
  74. package/demos/base-demo/mobileLive.html +117 -0
  75. package/demos/base-demo/mobileRec.html +116 -0
  76. package/demos/base-demo/multi.html +129 -0
  77. package/demos/base-demo/pcLive.html +117 -0
  78. package/demos/base-demo/pcRec.html +116 -0
  79. package/demos/base-demo/template.html +124 -0
  80. package/demos/base-demo/themeData.html +232 -0
  81. package/demos/nginx-demo/conf/fastcgi.conf +26 -0
  82. package/demos/nginx-demo/conf/fastcgi_params +25 -0
  83. package/demos/nginx-demo/conf/koi-utf +109 -0
  84. package/demos/nginx-demo/conf/koi-win +103 -0
  85. package/demos/nginx-demo/conf/mime.types +95 -0
  86. package/demos/nginx-demo/conf/nginx.conf +121 -0
  87. package/demos/nginx-demo/conf/scgi_params +17 -0
  88. package/demos/nginx-demo/conf/uwsgi_params +17 -0
  89. package/demos/nginx-demo/conf/win-utf +126 -0
  90. package/demos/nginx-demo/contrib/README +21 -0
  91. package/demos/nginx-demo/contrib/geo2nginx.pl +58 -0
  92. package/demos/nginx-demo/contrib/unicode2nginx/koi-utf +131 -0
  93. package/demos/nginx-demo/contrib/unicode2nginx/unicode-to-nginx.pl +48 -0
  94. package/demos/nginx-demo/contrib/unicode2nginx/win-utf +130 -0
  95. package/demos/nginx-demo/contrib/vim/ftdetect/nginx.vim +4 -0
  96. package/demos/nginx-demo/contrib/vim/ftplugin/nginx.vim +1 -0
  97. package/demos/nginx-demo/contrib/vim/indent/nginx.vim +11 -0
  98. package/demos/nginx-demo/contrib/vim/syntax/nginx.vim +2268 -0
  99. package/demos/nginx-demo/docs/CHANGES +8115 -0
  100. package/demos/nginx-demo/docs/CHANGES.ru +8252 -0
  101. package/demos/nginx-demo/docs/LICENSE +26 -0
  102. package/demos/nginx-demo/docs/OpenSSL.LICENSE +127 -0
  103. package/demos/nginx-demo/docs/PCRE.LICENCE +93 -0
  104. package/demos/nginx-demo/docs/README +3 -0
  105. package/demos/nginx-demo/docs/zlib.LICENSE +20 -0
  106. package/demos/nginx-demo/html/50x.html +21 -0
  107. package/demos/nginx-demo/html/ezuikit5/ezuikit.js +36107 -0
  108. package/demos/nginx-demo/html/ezuikit5/index.html +117 -0
  109. package/demos/nginx-demo/html/ezuikit5/server.js +67 -0
  110. package/demos/nginx-demo/html/index.html +16 -0
  111. package/demos/nginx-demo/html/js/adapeter.js +5497 -0
  112. package/demos/nginx-demo/html/js/janus.js +3507 -0
  113. package/demos/nginx-demo/html/js/jquery.min.js +2 -0
  114. package/demos/nginx-demo/html/js/sts.js +340 -0
  115. package/demos/nginx-demo/logs/access.log +109 -0
  116. package/demos/nginx-demo/logs/error.log +15 -0
  117. package/demos/nginx-demo/logs/nginx.pid +1 -0
  118. package/demos/nginx-demo/nginx.exe +0 -0
  119. package/demos/react-demo/README.md +68 -0
  120. package/demos/react-demo/package.json +36 -0
  121. package/demos/react-demo/public/favicon.ico +0 -0
  122. package/demos/react-demo/public/index.html +43 -0
  123. package/demos/react-demo/public/logo192.png +0 -0
  124. package/demos/react-demo/public/logo512.png +0 -0
  125. package/demos/react-demo/public/manifest.json +25 -0
  126. package/demos/react-demo/public/robots.txt +3 -0
  127. package/demos/react-demo/src/App.css +38 -0
  128. package/demos/react-demo/src/App.js +114 -0
  129. package/demos/react-demo/src/App.test.js +9 -0
  130. package/demos/react-demo/src/index.css +13 -0
  131. package/demos/react-demo/src/index.js +17 -0
  132. package/demos/react-demo/src/logo.svg +7 -0
  133. package/demos/react-demo/src/serviceWorker.js +141 -0
  134. package/demos/react-demo/src/setupTests.js +5 -0
  135. package/demos/vue-demo/README.md +24 -0
  136. package/demos/vue-demo/babel.config.js +5 -0
  137. package/demos/vue-demo/package.json +43 -0
  138. package/demos/vue-demo/public/favicon.ico +0 -0
  139. package/demos/vue-demo/public/index.html +17 -0
  140. package/demos/vue-demo/src/App.vue +27 -0
  141. package/demos/vue-demo/src/assets/logo.png +0 -0
  142. package/demos/vue-demo/src/components/EZUIKitJs.vue +115 -0
  143. package/demos/vue-demo/src/main.js +8 -0
  144. package/ezuikit.js +1758 -75352
  145. package/ezuikit_static/v65/v1/css/component.css +1257 -0
  146. package/ezuikit_static/v65/v1/css/inspectTheme.css +352 -0
  147. package/ezuikit_static/v65/v1/css/theme.css +1 -483
  148. package/ezuikit_static/v65/v1/imgs/empty.png +0 -0
  149. package/ezuikit_static/v65/v1/imgs/fallback.svg +52 -0
  150. package/ezuikit_static/v65/v3/css/component.css +1257 -0
  151. package/ezuikit_static/v65/v3/css/inspectTheme.css +352 -0
  152. package/ezuikit_static/v65/v3/css/theme.css +0 -35
  153. package/ezuikit_static/v65/v3/imgs/bg.svg +33 -0
  154. package/ezuikit_static/v65/v3/imgs/empty.png +0 -0
  155. package/ezuikit_static/v65/v3/imgs/fallback.svg +52 -0
  156. package/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/HasSIMD/Decoder.js +21 -0
  157. package/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/HasSIMD/Decoder.wasm +0 -0
  158. package/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/HasSIMD/Decoder.worker.js +1 -0
  159. package/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/NoSIMD/Decoder.js +21 -0
  160. package/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/NoSIMD/Decoder.wasm +0 -0
  161. package/ezuikit_static/v65/v3/js/PlayCtrlWasm/hasWorker/NoSIMD/Decoder.worker.js +1 -0
  162. package/ezuikit_static/v65/v3/js/jsPluginV3-1.0.0.min.js +3 -3
  163. package/package.json +1 -6
@@ -0,0 +1,343 @@
1
+ // We make use of this 'server' variable to provide the address of the
2
+ // REST Janus API. By default, in this example we assume that Janus is
3
+ // co-located with the web server hosting the HTML pages but listening
4
+ // on a different port (8088, the default for HTTP in Janus), which is
5
+ // why we make use of the 'window.location.hostname' base address. Since
6
+ // Janus can also do HTTPS, and considering we don't really want to make
7
+ // use of HTTP for Janus if your demos are served on HTTPS, we also rely
8
+ // on the 'window.location.protocol' prefix to build the variable, in
9
+ // particular to also change the port used to contact Janus (8088 for
10
+ // HTTP and 8089 for HTTPS, if enabled).
11
+ // In case you place Janus behind an Apache frontend (as we did on the
12
+ // online demos at http://janus.conf.meetecho.com) you can just use a
13
+ // relative path for the variable, e.g.:
14
+ //
15
+ // var server = "/janus";
16
+ //
17
+ // which will take care of this on its own.
18
+ //
19
+ //
20
+ // If you want to use the WebSockets frontend to Janus, instead, you'll
21
+ // have to pass a different kind of address, e.g.:
22
+ //
23
+ // var server = "ws://" + window.location.hostname + ":8188";
24
+ //
25
+ // Of course this assumes that support for WebSockets has been built in
26
+ // when compiling the server. WebSockets support has not been tested
27
+ // as much as the REST API, so handle with care!
28
+ //
29
+ //
30
+ // If you have multiple options available, and want to let the library
31
+ // autodetect the best way to contact your server (or pool of servers),
32
+ // you can also pass an array of servers, e.g., to provide alternative
33
+ // means of access (e.g., try WebSockets first and, if that fails, fall
34
+ // back to plain HTTP) or just have failover servers:
35
+ //
36
+ // var server = [
37
+ // "ws://" + window.location.hostname + ":8188",
38
+ // "/janus"
39
+ // ];
40
+ //
41
+ // This will tell the library to try connecting to each of the servers
42
+ // in the presented order. The first working server will be used for
43
+ // the whole session.
44
+ //
45
+ var server = null;
46
+ if(window.location.protocol === 'http:')
47
+ //server = "http://" + window.location.hostname + ":9020/janus";
48
+ // yujianbo
49
+ server = "https://" + "10.80.21.211" + ":9022/janus";
50
+ else
51
+ //server = "https://" + window.location.hostname + ":9022/janus";
52
+ // -yujianbo
53
+ server = "https://" + "10.80.21.211" + ":9022/janus";
54
+
55
+ var janus = null;
56
+ var tts = null;
57
+ var opaqueId = "tts-"+Janus.randomString(12);
58
+
59
+ var spinner = null;
60
+
61
+ // Initialize the library (all console debuggers enabled)
62
+ Janus.init({debug: "all", callback: function() {
63
+ window.stopTalk = function (){
64
+ janus.destroy();
65
+ }
66
+ // debugger;
67
+ window.startTalk = function() {
68
+ // Make sure the browser supports WebRTC
69
+ if(!Janus.isWebrtcSupported()) {
70
+ bootbox.alert("No WebRTC support... ");
71
+ return;
72
+ }
73
+
74
+ // if($('#tts_url').val().length == 0){
75
+ // bootbox.alert("Please input tts url... ");
76
+ // return;
77
+ // }
78
+
79
+ // $(this).attr('disabled', true).unbind('click');
80
+
81
+ // Create session
82
+ janus = new Janus(
83
+ {
84
+ server: window.EZUIKit.opt.rtcUrl,
85
+ // No "iceServers" is provided, meaning janus.js will use a default STUN server
86
+ // Here are some examples of how an iceServers field may look like to support TURN
87
+ // iceServers: [{urls: "turn:yourturnserver.com:3478", username: "janususer", credential: "januspwd"}],
88
+ // iceServers: [{urls: "turn:yourturnserver.com:443?transport=tcp", username: "janususer", credential: "januspwd"}],
89
+ // iceServers: [{urls: "turns:yourturnserver.com:443?transport=tcp", username: "janususer", credential: "januspwd"}],
90
+ // Should the Janus API require authentication, you can specify either the API secret or user token here too
91
+ // token: "mytoken",
92
+ // or
93
+ // apisecret: "serversecret",
94
+ success: function() {
95
+ // Attach to tts plugin
96
+ janus.attach(
97
+ {
98
+ plugin: "rtcgw.plugin.tts",
99
+ opaqueId: opaqueId,
100
+ success: function(pluginHandle) {
101
+ // $('#details').remove();
102
+ tts = pluginHandle;
103
+ Janus.log("Plugin attached! (" + tts.getPlugin() + ", id=" + tts.getId() + ")");
104
+ // Negotiate WebRTC
105
+ //var url = "tts://61.130.6.23:8664/talk://D13781761:0:1:cas.ys7.com:6500?97fbd2a75fa94b7682c994d3d1fac8ca:ut.5porslgu79e9r7ca48z32k8abgl3rp58-77bhb6i7xr-1kmumtg-jkhy7pvfr:0:3"
106
+
107
+
108
+ //var url = "tts://10.86.15.209:8664/talk://D13781761:0:1:cas.ys7.com:6500?32db2578ba7c4a84be22ecc0bcd0f8db:ut.5lqpkhim5m7cdk2y5w60g7hm9vd7i3v0-3d2pwhxe2t-11wx2ge-sh4yazbll:0:3"
109
+ //var url = "tts://10.86.15.209:8664/talk://D13781761:0:1:cas.ys7.com:6500"
110
+ //test12.ys.com
111
+ //var url = "tts://10.86.15.209:8664/talk://D08197169:0:1:cas.ys7.com:6500"
112
+ //test10.ys.com
113
+ //var url = "tts://10.86.29.210:8664/talk://D08197169:0:1:cas.ys7.com:6500"
114
+ var url = window.EZUIKit.opt.talkLink;
115
+ console.log("ttsUlr",url);
116
+ var body = { "request": "start", "url": url, "codec": "opus", "dir": "sendrecv", "audio_debug": 1};
117
+ //tts.send({"message": body});
118
+ Janus.debug("Trying a createOffer too (audio/video sendrecv)");
119
+ tts.createOffer(
120
+ {
121
+ // No media provided: by default, it's sendrecv for audio and video
122
+ media: { audio: true, video: false, data: false }, // Audio only
123
+ // If you want to test simulcasting (Chrome and Firefox only), then
124
+ // pass a ?simulcast=true when opening this demo page: it will turn
125
+ // the following 'simulcast' property to pass to janus.js to true
126
+ simulcast: false,
127
+ simulcast2: false,
128
+ success: function(jsep) {
129
+ Janus.debug("Got SDP!");
130
+ Janus.debug(jsep);
131
+ tts.send({"message": body, "jsep": jsep});
132
+ if(typeof window.EZUIKit.handleTalkSuccess !== 'undefined'){
133
+ window.EZUIKit.handleTalkSuccess();
134
+ }
135
+ },
136
+ error: function(error) {
137
+ Janus.error("WebRTC error:", error);
138
+ // bootbox.alert("WebRTC error... " + JSON.stringify(error));
139
+ if(typeof window.EZUIKit.handleTalkError !== 'undefined'){
140
+ window.EZUIKit.handleTalkError(error);
141
+ }
142
+ }
143
+ });
144
+ // $('#start').removeAttr('disabled').html("Stop")
145
+ // .click(function() {
146
+ // $(this).attr('disabled', true);
147
+ // janus.destroy();
148
+ // });
149
+ },
150
+ error: function(error) {
151
+ console.error(" -- Error attaching plugin...", error);
152
+ bootbox.alert("Error attaching plugin... " + error);
153
+ if(window.EZUIKit.handleTalkError !== 'undefined'){
154
+ window.EZUIKit.handleTalkError(error);
155
+ }
156
+ },
157
+ consentDialog: function(on) {
158
+ Janus.debug("Consent dialog should be " + (on ? "on" : "off") + " now");
159
+ if(on) {
160
+ // Darken screen and show hint
161
+ // $.blockUI({
162
+ // message: '<div><img src="up_arrow.png"/></div>',
163
+ // css: {
164
+ // border: 'none',
165
+ // padding: '15px',
166
+ // backgroundColor: 'transparent',
167
+ // color: '#aaa',
168
+ // top: '10px',
169
+ // left: (navigator.mozGetUserMedia ? '-100px' : '300px')
170
+ // } });
171
+ } else {
172
+ // Restore screen
173
+ // $.unblockUI();
174
+ }
175
+ },
176
+ iceState: function(state) {
177
+ Janus.log("ICE state changed to " + state);
178
+ },
179
+ mediaState: function(medium, on) {
180
+ Janus.log("Janus " + (on ? "started" : "stopped") + " receiving our " + medium);
181
+ },
182
+ webrtcState: function(on) {
183
+ Janus.log("Janus says our WebRTC PeerConnection is " + (on ? "up" : "down") + " now");
184
+ // $("#audioleft").parent().unblock();
185
+ },
186
+ slowLink: function(uplink, lost) {
187
+ Janus.warn("Janus reports problems " + (uplink ? "sending" : "receiving") +
188
+ " packets on this PeerConnection (" + lost + " lost packets)");
189
+ },
190
+ onmessage: function(msg, jsep) {
191
+ Janus.debug(" ::: Got a message :::");
192
+ Janus.debug(msg);
193
+ if(jsep !== undefined && jsep !== null) {
194
+ Janus.debug("Handling SDP as well...");
195
+ Janus.debug(jsep);
196
+ tts.handleRemoteJsep({jsep: jsep});
197
+ }
198
+ var result = msg["result"];
199
+ if(result !== null && result !== undefined) {
200
+ if(result === "done") {
201
+ // The plugin closed
202
+ bootbox.alert("The TTS Test is over");
203
+ if(spinner !== null && spinner !== undefined)
204
+ spinner.stop();
205
+ spinner = null;
206
+ // $('#myaudio').remove();
207
+ //$('#waitingvideo').remove();
208
+ // $('#peeraudio').remove();
209
+ return;
210
+ }
211
+
212
+ if(result === "msg"){
213
+ if(typeof window.EZUIKit.handleTalkMessage !== 'undefined'){
214
+ window.EZUIKit.handleTalkMessage(msg);
215
+ }
216
+ }
217
+ // Any loss?
218
+ var status = result["status"];
219
+ if(status === "slow_link") {
220
+ //~ var bitrate = result["bitrate"];
221
+ //~ toastr.warning("The bitrate has been cut to " + (bitrate/1000) + "kbps", "Packet loss?", {timeOut: 2000});
222
+ toastr.warning("Janus apparently missed many packets we sent, maybe we should reduce the bitrate", "Packet loss?", {timeOut: 2000});
223
+ }
224
+ }
225
+ },
226
+ onlocalstream: function(stream) {
227
+ Janus.debug(" ::: Got a local stream :::");
228
+ Janus.debug(stream);
229
+
230
+ // if($('#myaudio').length === 0) {
231
+ // $('#audios').removeClass('hide').show();
232
+ // $('#audioleft').append('<audio id="myaudio" autoplay controls muted>Your browser does not support audio tag</audio>');
233
+ // }
234
+ Janus.attachMediaStream(document.getElementById("myaudio"), stream);
235
+ //$("#myaudio").get(0).muted = "muted";
236
+ if(tts.webrtcStuff.pc.iceConnectionState !== "completed" &&
237
+ tts.webrtcStuff.pc.iceConnectionState !== "connected") {
238
+ // $("#audioleft").parent().block({
239
+ // message: '<b>Publishing...</b>',
240
+ // css: {
241
+ // border: 'none',
242
+ // backgroundColor: 'transparent',
243
+ // color: 'white'
244
+ // }
245
+ // });
246
+ // No remote video yet
247
+ //$('#audioright').append('<video class="rounded centered" id="waitingvideo" width=320 height=240 />');
248
+ if(spinner == null) {
249
+ var target = document.getElementById('audioright');
250
+ //spinner = new Spinner({top:100}).spin(target);
251
+ } else {
252
+ spinner.spin();
253
+ }
254
+ }
255
+ var audioTracks = stream.getAudioTracks();
256
+ if(audioTracks === null || audioTracks === undefined || audioTracks.length === 0) {
257
+ // $('#myaudio').hide();
258
+ } else {
259
+ // $('#myaudio').removeClass('hide').show();
260
+ // document.getElementById('myaudio').play();
261
+ }
262
+ },
263
+ onremotestream: function(stream) {
264
+ Janus.debug(" ::: Got a remote stream :::");
265
+ Janus.debug(stream);
266
+ // if($('#peeraudio').length === 0) {
267
+ // $('#audios').removeClass('hide').show();
268
+ // // $('#audioright').append('<audio id="peeraudio" autoplay controls>Your browser does not support audio tag</audio>');
269
+ // // Show the video, hide the spinner and show the resolution when we get a playing event
270
+ // var audio = $('<audio id="peeraudio" autoplay controls playsinline preload="preload" loop="true"></audio>');
271
+ // audio = audio.get(0);
272
+ // audio.setAttribute("id", 'peeraudio');
273
+ // audio.setAttribute("preload","preload");
274
+ // // 自动播放解决苹果不兼容autoplay属性
275
+ // audio.setAttribute("loop",true);
276
+ // $('#audioright').append(audio);
277
+ // $("#peeraudio").bind("playing", function () {
278
+ // //$('#waitingvideo').remove();
279
+ // $('#peeraudio').removeClass('hide').show();
280
+ // if(spinner !== null && spinner !== undefined)
281
+ // spinner.stop();
282
+ // spinner = null;
283
+ // });
284
+ // }
285
+ Janus.attachMediaStream(document.getElementById("peeraudio"), stream);
286
+ var audioTracks = stream.getAudioTracks();
287
+ if(audioTracks === null || audioTracks === undefined || audioTracks.length === 0) {
288
+ // $('#peeraudio').hide();
289
+ } else {
290
+ // $('#peeraudio').removeClass('hide').show();
291
+ document.getElementById('peeraudio').play();
292
+ }
293
+ },
294
+ ondataopen: function(data) {
295
+ Janus.log("The DataChannel is available!");
296
+ },
297
+ ondata: function(data) {
298
+ Janus.debug("We got data from the DataChannel! " + data);
299
+ },
300
+ oncleanup: function() {
301
+ Janus.log(" ::: Got a cleanup notification :::");
302
+ if(spinner !== null && spinner !== undefined)
303
+ spinner.stop();
304
+ spinner = null;
305
+ // $('#myaudio').remove();
306
+ // //$('#waitingvideo').remove();
307
+ // $("#audioleft").parent().unblock();
308
+ // $('#peeraudio').remove();
309
+ }
310
+ });
311
+ },
312
+ error: function(error) {
313
+ Janus.error(error);
314
+ if(window.EZUIKit.handleTalkError !== 'undefined'){
315
+ window.EZUIKit.handleTalkError(error);
316
+ }
317
+ },
318
+ destroyed: function() {
319
+ // window.location.reload();
320
+ }
321
+ });
322
+ }
323
+
324
+ }});
325
+
326
+ function checkEnter(event) {
327
+ var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
328
+ if(theCode == 13) {
329
+ sendData();
330
+ return false;
331
+ } else {
332
+ return true;
333
+ }
334
+ }
335
+
336
+ // Helper to parse query string
337
+ function getQueryStringValue(name) {
338
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
339
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
340
+ results = regex.exec(location.search);
341
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
342
+ }
343
+
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
7
+ <title>Document</title>
8
+ <script src="./ezuikit.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div className="demo">
13
+ <h2>视频模式使用示例:</h2>
14
+ <video id="hlsId" autoplay controls style="width: 600px;height:400px"></video>
15
+ <video id="hlsId2" autoplay controls style="width: 600px;height:400px"></video>
16
+ </div>
17
+ <script>
18
+ var hlsDemo = new EZUIKit.HLS("hlsId","https://open.ys7.com/v3/openlive/C78957921_1_2.m3u8?expire=1687488306&id=461844489422516224&t=96ea4ce49d2ea4f2f65d045edbe8fa1a51ef9fac6f38e150052bc64a91c27db7&ev=100");
19
+
20
+ var hlsDemo2 = new EZUIKit.HLS("hlsId2","https://open.ys7.com/v3/openlive/AA2615287_1_2.m3u8?expire=1687487466&id=461840962679742464&t=c076d5a5ad56090e919a6a2500b96169c20a77874cce866a87a7d65e493e6f2f&ev=100");
21
+ </script>
22
+ </body>
23
+
24
+ </html>
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
7
+ <title>Document</title>
8
+ <script src="./ezuikit.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div className="demo">
13
+ <h2>视频模式使用示例:</h2>
14
+ <div id="video-container" style="width:600px;">
15
+ </div>
16
+ <div>
17
+ <button onClick="play()">play</button>
18
+ <button onClick="stop()">stop</button>
19
+ <button onClick="getOSDTime()">getOSDTime</button>
20
+ <button onClick="getOSDTime2()">getOSDTime2</button>
21
+ <button onClick="capturePicture()">capturePicture</button>
22
+ <button onClick="openSound()">openSound</button>
23
+ <button onClick="closeSound()">closeSound</button>
24
+ <button onClick="startSave()">startSave</button>
25
+ <button onClick="stopSave()">stopSave</button>
26
+ <button onClick="ezopenStartTalk()">开始对讲</button>
27
+ <button onClick="ezopenStopTalk()">结束对讲</button>
28
+ <button onClick="fullScreen()">全屏</button>
29
+ </div>
30
+ <p style="font-style: italic;">播放多个视频,可初始化多个实例,参考:/demos/base-demo/multi-demo</p>
31
+ </div>
32
+ <script>
33
+ var playr;
34
+ fetch('https://open.ys7.com/jssdk/ezopen/demo/token')
35
+ .then(response => response.json())
36
+ .then(res => {
37
+ var accessToken = res.data.accessToken;
38
+ playr = new EZUIKit.EZUIKitPlayer({
39
+ id: 'video-container', // 视频容器ID
40
+ accessToken: accessToken,
41
+ url: 'ezopen://open.ys7.com/AA2615287/1.live',
42
+ // template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
43
+ plugin: ['talk'], // 加载插件,talk-对讲
44
+ width: 600,
45
+ height: 400,
46
+ });
47
+ });
48
+ function fullScreen() {
49
+ var playPromise = playr.fullScreen();
50
+ playPromise.then((data) => {
51
+ console.log("promise 获取 数据", data)
52
+ })
53
+ }
54
+ function play() {
55
+ var playPromise = playr.play();
56
+ playPromise.then((data) => {
57
+ console.log("promise 获取 数据", data)
58
+ })
59
+ }
60
+ function stop() {
61
+ var stopPromise = playr.stop();
62
+ stopPromise.then((data) => {
63
+ console.log("promise 获取 数据", data)
64
+ })
65
+ }
66
+ function getOSDTime() {
67
+ var getOSDTimePromise = playr.getOSDTime();
68
+ getOSDTimePromise.then((data) => {
69
+ console.log("promise 获取 数据", data)
70
+ })
71
+ }
72
+ function getOSDTime2() {
73
+ var getOSDTimePromise = playr2.getOSDTime();
74
+ getOSDTimePromise.then((data) => {
75
+ console.log("promise 获取 数据", data)
76
+ })
77
+ }
78
+ function capturePicture() {
79
+ var capturePicturePromise = playr.capturePicture();
80
+ capturePicturePromise.then((data) => {
81
+ console.log("promise 获取 数据", data)
82
+ })
83
+ }
84
+ function openSound() {
85
+ var openSoundPromise = playr.openSound();
86
+ openSoundPromise.then((data) => {
87
+ console.log("promise 获取 数据", data)
88
+ })
89
+ }
90
+ function closeSound() {
91
+ var closeSoundPromise = playr.closeSound();
92
+ closeSoundPromise.then((data) => {
93
+ console.log("promise 获取 数据", data)
94
+ })
95
+ }
96
+ function startSave() {
97
+ var startSavePromise = playr.startSave(`${new Date().getTime()}`);
98
+ startSavePromise.then((data) => {
99
+ console.log("promise 获取 数据", data)
100
+ })
101
+ }
102
+ function stopSave() {
103
+ var stopSavePromise = playr.stopSave();
104
+ stopSavePromise.then((data) => {
105
+ console.log("promise 获取 数据", data)
106
+ })
107
+ }
108
+ function ezopenStartTalk() {
109
+ playr.startTalk();
110
+ }
111
+ function ezopenStopTalk() {
112
+ playr.stopTalk();
113
+ }
114
+ </script>
115
+ </body>
116
+
117
+ </html>
@@ -0,0 +1,118 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
7
+ <title>Document</title>
8
+ <script src="./ezuikit.js"></script>
9
+ </head>
10
+
11
+ <body>
12
+ <div className="demo">
13
+ <h2>视频模式使用示例:</h2>
14
+ <div id="video-container" style="width:600px;">
15
+ </div>
16
+ <div>
17
+ <button onClick="play()">play</button>
18
+ <button onClick="stop()">stop</button>
19
+ <button onClick="getOSDTime()">getOSDTime</button>
20
+ <button onClick="getOSDTime2()">getOSDTime2</button>
21
+ <button onClick="capturePicture()">capturePicture</button>
22
+ <button onClick="openSound()">openSound</button>
23
+ <button onClick="closeSound()">closeSound</button>
24
+ <button onClick="startSave()">startSave</button>
25
+ <button onClick="stopSave()">stopSave</button>
26
+ <button onClick="ezopenStartTalk()">开始对讲</button>
27
+ <button onClick="ezopenStopTalk()">结束对讲</button>
28
+ <button onClick="fullScreen()">全屏</button>
29
+ </div>
30
+ <p style="font-style: italic;">播放多个视频,可初始化多个实例,参考:/demos/base-demo/multi-demo</p>
31
+ </div>
32
+ <script>
33
+ var playr;
34
+ fetch('https://open.ys7.com/jssdk/ezopen/demo/token')
35
+ .then(response => response.json())
36
+ .then(res => {
37
+ var accessToken = res.data.accessToken;
38
+ playr = new EZUIKit.EZUIKitPlayer({
39
+ id: 'video-container', // 视频容器ID
40
+ accessToken: accessToken,
41
+ url: 'ezopen://open.ys7.com/AA2615287/1.live',
42
+ template: 'simple', // simple - 极简版;standard-标准版;security - 安防版(预览回放);voice-语音版; theme-可配置主题;
43
+ plugin: ['talk'], // 加载插件,talk-对讲
44
+ staticPath: "/ezuikit_js/ezuikit_static/v64",
45
+ width: 600,
46
+ height: 400,
47
+ });
48
+ });
49
+ function fullScreen() {
50
+ var playPromise = playr.fullScreen();
51
+ playPromise.then((data) => {
52
+ console.log("promise 获取 数据", data)
53
+ })
54
+ }
55
+ function play() {
56
+ var playPromise = playr.play();
57
+ playPromise.then((data) => {
58
+ console.log("promise 获取 数据", data)
59
+ })
60
+ }
61
+ function stop() {
62
+ var stopPromise = playr.stop();
63
+ stopPromise.then((data) => {
64
+ console.log("promise 获取 数据", data)
65
+ })
66
+ }
67
+ function getOSDTime() {
68
+ var getOSDTimePromise = playr.getOSDTime();
69
+ getOSDTimePromise.then((data) => {
70
+ console.log("promise 获取 数据", data)
71
+ })
72
+ }
73
+ function getOSDTime2() {
74
+ var getOSDTimePromise = playr2.getOSDTime();
75
+ getOSDTimePromise.then((data) => {
76
+ console.log("promise 获取 数据", data)
77
+ })
78
+ }
79
+ function capturePicture() {
80
+ var capturePicturePromise = playr.capturePicture();
81
+ capturePicturePromise.then((data) => {
82
+ console.log("promise 获取 数据", data)
83
+ })
84
+ }
85
+ function openSound() {
86
+ var openSoundPromise = playr.openSound();
87
+ openSoundPromise.then((data) => {
88
+ console.log("promise 获取 数据", data)
89
+ })
90
+ }
91
+ function closeSound() {
92
+ var closeSoundPromise = playr.closeSound();
93
+ closeSoundPromise.then((data) => {
94
+ console.log("promise 获取 数据", data)
95
+ })
96
+ }
97
+ function startSave() {
98
+ var startSavePromise = playr.startSave(`${new Date().getTime()}`);
99
+ startSavePromise.then((data) => {
100
+ console.log("promise 获取 数据", data)
101
+ })
102
+ }
103
+ function stopSave() {
104
+ var stopSavePromise = playr.stopSave();
105
+ stopSavePromise.then((data) => {
106
+ console.log("promise 获取 数据", data)
107
+ })
108
+ }
109
+ function ezopenStartTalk() {
110
+ playr.startTalk();
111
+ }
112
+ function ezopenStopTalk() {
113
+ playr.stopTalk();
114
+ }
115
+ </script>
116
+ </body>
117
+
118
+ </html>