create-jsview 2.1.428 → 2.1.435

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 (260) hide show
  1. package/package.json +2 -2
  2. package/template-vue-vite/package-lock-json +6 -6
  3. package/template-vue-vite/package.json +2 -2
  4. package/template-vue-vite/dist-test-jsview-chunk/assets/1.54c7645a.png +0 -0
  5. package/template-vue-vite/dist-test-jsview-chunk/assets/1.5dc15599.png +0 -0
  6. package/template-vue-vite/dist-test-jsview-chunk/assets/1280x7200.f72b317a.jpg +0 -0
  7. package/template-vue-vite/dist-test-jsview-chunk/assets/2.c46fde4a.png +0 -0
  8. package/template-vue-vite/dist-test-jsview-chunk/assets/2.df10a8ad.png +0 -0
  9. package/template-vue-vite/dist-test-jsview-chunk/assets/3.920d6934.png +0 -0
  10. package/template-vue-vite/dist-test-jsview-chunk/assets/3.dd39d2bc.png +0 -0
  11. package/template-vue-vite/dist-test-jsview-chunk/assets/4.4cd633a0.jpg +0 -0
  12. package/template-vue-vite/dist-test-jsview-chunk/assets/4.f58de085.png +0 -0
  13. package/template-vue-vite/dist-test-jsview-chunk/assets/Couplets.22a8bcb3.png +0 -0
  14. package/template-vue-vite/dist-test-jsview-chunk/assets/Square.2085a1e3.png +0 -0
  15. package/template-vue-vite/dist-test-jsview-chunk/assets/animated_webp.df116064.webp +0 -0
  16. package/template-vue-vite/dist-test-jsview-chunk/assets/ball_3.6443240f.webp +0 -0
  17. package/template-vue-vite/dist-test-jsview-chunk/assets/bg1.9dacd4a9.png +0 -0
  18. package/template-vue-vite/dist-test-jsview-chunk/assets/bg2.05147169.png +0 -0
  19. package/template-vue-vite/dist-test-jsview-chunk/assets/bg3.4725410a.png +0 -0
  20. package/template-vue-vite/dist-test-jsview-chunk/assets/bg4.67998d21.png +0 -0
  21. package/template-vue-vite/dist-test-jsview-chunk/assets/bg5.e6aeb8ef.png +0 -0
  22. package/template-vue-vite/dist-test-jsview-chunk/assets/bg_btn.3bc67ce7.png +0 -0
  23. package/template-vue-vite/dist-test-jsview-chunk/assets/bgimage.9ebd66c5.jpg +0 -0
  24. package/template-vue-vite/dist-test-jsview-chunk/assets/bgmusic.bf797943.mp3 +0 -0
  25. package/template-vue-vite/dist-test-jsview-chunk/assets/blue_egg.a2c54f95.png +0 -0
  26. package/template-vue-vite/dist-test-jsview-chunk/assets/bmpDemo.e06bdb19.bmp +0 -0
  27. package/template-vue-vite/dist-test-jsview-chunk/assets/boom.159be4de.mp3 +0 -0
  28. package/template-vue-vite/dist-test-jsview-chunk/assets/border.32f99a05.png +0 -0
  29. package/template-vue-vite/dist-test-jsview-chunk/assets/btn_ok.a0827ed4.png +0 -0
  30. package/template-vue-vite/dist-test-jsview-chunk/assets/coin.50aac2a4.mp3 +0 -0
  31. package/template-vue-vite/dist-test-jsview-chunk/assets/coupon_left.c9f544cb.png +0 -0
  32. package/template-vue-vite/dist-test-jsview-chunk/assets/coupon_mid.ef262879.png +0 -0
  33. package/template-vue-vite/dist-test-jsview-chunk/assets/coupon_right.248ee7dc.png +0 -0
  34. package/template-vue-vite/dist-test-jsview-chunk/assets/egg_break.e01a800c.png +0 -0
  35. package/template-vue-vite/dist-test-jsview-chunk/assets/fail.446dfd56.png +0 -0
  36. package/template-vue-vite/dist-test-jsview-chunk/assets/firecracker.bf5b0aa9.png +0 -0
  37. package/template-vue-vite/dist-test-jsview-chunk/assets/fireworks.1c112f43.png +0 -0
  38. package/template-vue-vite/dist-test-jsview-chunk/assets/focus1.ff67f2e6.png +0 -0
  39. package/template-vue-vite/dist-test-jsview-chunk/assets/get.3509893a.mp3 +0 -0
  40. package/template-vue-vite/dist-test-jsview-chunk/assets/girl_run.1c322b33.gif +0 -0
  41. package/template-vue-vite/dist-test-jsview-chunk/assets/goldencoin1.d31809e9.png +0 -0
  42. package/template-vue-vite/dist-test-jsview-chunk/assets/goldencoin2.3f5b59d2.png +0 -0
  43. package/template-vue-vite/dist-test-jsview-chunk/assets/holder_logo.5d13253c.png +0 -0
  44. package/template-vue-vite/dist-test-jsview-chunk/assets/icon.0d3ef206.png +0 -0
  45. package/template-vue-vite/dist-test-jsview-chunk/assets/jpegDemo.ede7ed35.jpeg +0 -0
  46. package/template-vue-vite/dist-test-jsview-chunk/assets/jump.d2e172b2.mp3 +0 -0
  47. package/template-vue-vite/dist-test-jsview-chunk/assets/jump_down.68b45798.png +0 -0
  48. package/template-vue-vite/dist-test-jsview-chunk/assets/jump_up.2f896dd9.png +0 -0
  49. package/template-vue-vite/dist-test-jsview-chunk/assets/leadWire.0c2130df.png +0 -0
  50. package/template-vue-vite/dist-test-jsview-chunk/assets/light.fd536e0c.png +0 -0
  51. package/template-vue-vite/dist-test-jsview-chunk/assets/light2.eac76425.png +0 -0
  52. package/template-vue-vite/dist-test-jsview-chunk/assets/line_left.36cc4bd9.png +0 -0
  53. package/template-vue-vite/dist-test-jsview-chunk/assets/line_mid.21f25bbe.png +0 -0
  54. package/template-vue-vite/dist-test-jsview-chunk/assets/line_right.3a4bbae6.png +0 -0
  55. package/template-vue-vite/dist-test-jsview-chunk/assets/lose.86f51553.mp3 +0 -0
  56. package/template-vue-vite/dist-test-jsview-chunk/assets/mask.c1211360.png +0 -0
  57. package/template-vue-vite/dist-test-jsview-chunk/assets/mathjax-tex-svg.d4295dc3.txt +0 -1
  58. package/template-vue-vite/dist-test-jsview-chunk/assets/php.9533a06f.jpg +0 -0
  59. package/template-vue-vite/dist-test-jsview-chunk/assets/php2.7e5cf392.png +0 -0
  60. package/template-vue-vite/dist-test-jsview-chunk/assets/pngNoAlphaDemo.8d9edc0f.png +0 -0
  61. package/template-vue-vite/dist-test-jsview-chunk/assets/purpleStar.b1920ac5.png +0 -0
  62. package/template-vue-vite/dist-test-jsview-chunk/assets/quan.54556d84.webp +0 -0
  63. package/template-vue-vite/dist-test-jsview-chunk/assets/redCircle.091d191f.png +0 -0
  64. package/template-vue-vite/dist-test-jsview-chunk/assets/redStar.9c31bb42.png +0 -0
  65. package/template-vue-vite/dist-test-jsview-chunk/assets/red_egg.27ca7d39.png +0 -0
  66. package/template-vue-vite/dist-test-jsview-chunk/assets/redpacket1.72196c20.png +0 -0
  67. package/template-vue-vite/dist-test-jsview-chunk/assets/redpacket2.0ae89a46.png +0 -0
  68. package/template-vue-vite/dist-test-jsview-chunk/assets/resultSquare.b9e3527b.png +0 -0
  69. package/template-vue-vite/dist-test-jsview-chunk/assets/roll.aa0dfe6f.png +0 -0
  70. package/template-vue-vite/dist-test-jsview-chunk/assets/run.b84383b2.png +0 -0
  71. package/template-vue-vite/dist-test-jsview-chunk/assets/scroll.c4efa5a1.png +0 -0
  72. package/template-vue-vite/dist-test-jsview-chunk/assets/scroll1.744c0b08.png +0 -0
  73. package/template-vue-vite/dist-test-jsview-chunk/assets/snow.22f35787.png +0 -0
  74. package/template-vue-vite/dist-test-jsview-chunk/assets/spark.50b3f017.png +0 -0
  75. package/template-vue-vite/dist-test-jsview-chunk/assets/star1.dd634833.png +0 -0
  76. package/template-vue-vite/dist-test-jsview-chunk/assets/star2.df352429.png +0 -0
  77. package/template-vue-vite/dist-test-jsview-chunk/assets/star3.5a62b76f.png +0 -0
  78. package/template-vue-vite/dist-test-jsview-chunk/assets/star4.2283606c.png +0 -0
  79. package/template-vue-vite/dist-test-jsview-chunk/assets/swipLight.ab6b2bc2.png +0 -0
  80. package/template-vue-vite/dist-test-jsview-chunk/assets/tease.3d7fb077.png +0 -0
  81. package/template-vue-vite/dist-test-jsview-chunk/assets/tease_lock.3602bb0d.png +0 -0
  82. package/template-vue-vite/dist-test-jsview-chunk/assets/test.671066bc.jpg +0 -0
  83. package/template-vue-vite/dist-test-jsview-chunk/assets/webpDemo.eb0b7786.webp +0 -0
  84. package/template-vue-vite/dist-test-jsview-chunk/assets/yellowStar.d80f0718.png +0 -0
  85. package/template-vue-vite/dist-test-jsview-chunk/css/App.0e83537d.css +0 -6
  86. package/template-vue-vite/dist-test-jsview-chunk/css/App.10e9d05f.css +0 -14
  87. package/template-vue-vite/dist-test-jsview-chunk/css/App.16cc5e4a.css +0 -20
  88. package/template-vue-vite/dist-test-jsview-chunk/css/App.18bd653b.css +0 -10
  89. package/template-vue-vite/dist-test-jsview-chunk/css/App.2943d6ec.css +0 -9
  90. package/template-vue-vite/dist-test-jsview-chunk/css/App.329ae9f6.css +0 -23
  91. package/template-vue-vite/dist-test-jsview-chunk/css/App.32c55297.css +0 -8
  92. package/template-vue-vite/dist-test-jsview-chunk/css/App.3e2a4eb1.css +0 -108
  93. package/template-vue-vite/dist-test-jsview-chunk/css/App.4ea37a27.css +0 -39
  94. package/template-vue-vite/dist-test-jsview-chunk/css/App.54fdcefd.css +0 -51
  95. package/template-vue-vite/dist-test-jsview-chunk/css/App.6406907b.css +0 -9
  96. package/template-vue-vite/dist-test-jsview-chunk/css/App.643b5c1b.css +0 -8
  97. package/template-vue-vite/dist-test-jsview-chunk/css/App.66f2f353.css +0 -553
  98. package/template-vue-vite/dist-test-jsview-chunk/css/App.76117f77.css +0 -21
  99. package/template-vue-vite/dist-test-jsview-chunk/css/App.7a70ea9d.css +0 -20
  100. package/template-vue-vite/dist-test-jsview-chunk/css/App.7ee969c5.css +0 -40
  101. package/template-vue-vite/dist-test-jsview-chunk/css/App.8056ee27.css +0 -144
  102. package/template-vue-vite/dist-test-jsview-chunk/css/App.81e870e8.css +0 -16
  103. package/template-vue-vite/dist-test-jsview-chunk/css/App.8a41b2c9.css +0 -4
  104. package/template-vue-vite/dist-test-jsview-chunk/css/App.8b7fc4be.css +0 -21
  105. package/template-vue-vite/dist-test-jsview-chunk/css/App.9acd4020.css +0 -9
  106. package/template-vue-vite/dist-test-jsview-chunk/css/App.9b8ef7c4.css +0 -17
  107. package/template-vue-vite/dist-test-jsview-chunk/css/App.9c2363fe.css +0 -11
  108. package/template-vue-vite/dist-test-jsview-chunk/css/App.9c9050df.css +0 -10
  109. package/template-vue-vite/dist-test-jsview-chunk/css/App.a37ce6b4.css +0 -78
  110. package/template-vue-vite/dist-test-jsview-chunk/css/App.acd46c9f.css +0 -29
  111. package/template-vue-vite/dist-test-jsview-chunk/css/App.be6992f1.css +0 -5
  112. package/template-vue-vite/dist-test-jsview-chunk/css/App.ce985162.css +0 -37
  113. package/template-vue-vite/dist-test-jsview-chunk/css/App.cf0eea52.css +0 -29
  114. package/template-vue-vite/dist-test-jsview-chunk/css/App.d80395de.css +0 -76
  115. package/template-vue-vite/dist-test-jsview-chunk/css/App.dc17d9ed.css +0 -355
  116. package/template-vue-vite/dist-test-jsview-chunk/css/App.e25f7308.css +0 -20
  117. package/template-vue-vite/dist-test-jsview-chunk/css/App.e3998d69.css +0 -10
  118. package/template-vue-vite/dist-test-jsview-chunk/css/App.e864d83a.css +0 -99
  119. package/template-vue-vite/dist-test-jsview-chunk/css/App.eea7c4d0.css +0 -37
  120. package/template-vue-vite/dist-test-jsview-chunk/css/App.f7bae60e.css +0 -24
  121. package/template-vue-vite/dist-test-jsview-chunk/css/App.fb916576.css +0 -53
  122. package/template-vue-vite/dist-test-jsview-chunk/css/App.ff455e8a.css +0 -23
  123. package/template-vue-vite/dist-test-jsview-chunk/css/DispersedItemSample.24d1e5c2.css +0 -31
  124. package/template-vue-vite/dist-test-jsview-chunk/css/Homepage.6291bd50.css +0 -60
  125. package/template-vue-vite/dist-test-jsview-chunk/css/HorizontalButtonList.f4192657.css +0 -12
  126. package/template-vue-vite/dist-test-jsview-chunk/css/MainPage.7bafbf88.css +0 -9
  127. package/template-vue-vite/dist-test-jsview-chunk/css/SubPage.e3029827.css +0 -17
  128. package/template-vue-vite/dist-test-jsview-chunk/css/index.bc47ba9c.css +0 -20
  129. package/template-vue-vite/dist-test-jsview-chunk/css/main.78821670.css +0 -11
  130. package/template-vue-vite/dist-test-jsview-chunk/debug/jsview-jsmap-serve.mjs +0 -130
  131. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-dom-browser.min.24b59670.js.map +0 -1
  132. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-dom-entry.280f04b1.js.map +0 -1
  133. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-dom-native.min.0039079f.js.map +0 -1
  134. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-engine-js-browser.min.f40edc22.js.map +0 -1
  135. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-forge-define.bfab260e.js.map +0 -1
  136. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-forge-define.min.26efdcd1.js.map +0 -1
  137. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-loader.f9249ad3.js.map +0 -1
  138. package/template-vue-vite/dist-test-jsview-chunk/debug/map/jsview-vue-entry.415721d8.js.map +0 -1
  139. package/template-vue-vite/dist-test-jsview-chunk/index.html +0 -14
  140. package/template-vue-vite/dist-test-jsview-chunk/js/App.0020360a.js +0 -141
  141. package/template-vue-vite/dist-test-jsview-chunk/js/App.073cedd6.js +0 -399
  142. package/template-vue-vite/dist-test-jsview-chunk/js/App.0f963d38.js +0 -95
  143. package/template-vue-vite/dist-test-jsview-chunk/js/App.11cde12f.js +0 -344
  144. package/template-vue-vite/dist-test-jsview-chunk/js/App.121965ad.js +0 -116
  145. package/template-vue-vite/dist-test-jsview-chunk/js/App.1575b8f0.js +0 -200
  146. package/template-vue-vite/dist-test-jsview-chunk/js/App.21ff555f.js +0 -455
  147. package/template-vue-vite/dist-test-jsview-chunk/js/App.29b9c765.js +0 -383
  148. package/template-vue-vite/dist-test-jsview-chunk/js/App.34ff6b40.js +0 -107
  149. package/template-vue-vite/dist-test-jsview-chunk/js/App.361be0b7.js +0 -144
  150. package/template-vue-vite/dist-test-jsview-chunk/js/App.368006e4.js +0 -431
  151. package/template-vue-vite/dist-test-jsview-chunk/js/App.36fc32c5.js +0 -192
  152. package/template-vue-vite/dist-test-jsview-chunk/js/App.386a753e.js +0 -259
  153. package/template-vue-vite/dist-test-jsview-chunk/js/App.3b0de676.js +0 -321
  154. package/template-vue-vite/dist-test-jsview-chunk/js/App.3e808b09.js +0 -92
  155. package/template-vue-vite/dist-test-jsview-chunk/js/App.40f6e609.js +0 -97
  156. package/template-vue-vite/dist-test-jsview-chunk/js/App.539ee14e.js +0 -331
  157. package/template-vue-vite/dist-test-jsview-chunk/js/App.55166fae.js +0 -189
  158. package/template-vue-vite/dist-test-jsview-chunk/js/App.56200035.js +0 -221
  159. package/template-vue-vite/dist-test-jsview-chunk/js/App.5698ed0a.js +0 -243
  160. package/template-vue-vite/dist-test-jsview-chunk/js/App.5788a834.js +0 -1675
  161. package/template-vue-vite/dist-test-jsview-chunk/js/App.5a51ba28.js +0 -788
  162. package/template-vue-vite/dist-test-jsview-chunk/js/App.5db3be20.js +0 -215
  163. package/template-vue-vite/dist-test-jsview-chunk/js/App.5f895413.js +0 -53
  164. package/template-vue-vite/dist-test-jsview-chunk/js/App.5f95520c.js +0 -320
  165. package/template-vue-vite/dist-test-jsview-chunk/js/App.64e2a47b.js +0 -276
  166. package/template-vue-vite/dist-test-jsview-chunk/js/App.69ca326b.js +0 -107
  167. package/template-vue-vite/dist-test-jsview-chunk/js/App.6f92a934.js +0 -277
  168. package/template-vue-vite/dist-test-jsview-chunk/js/App.6fafe9e2.js +0 -430
  169. package/template-vue-vite/dist-test-jsview-chunk/js/App.7067dfe2.js +0 -120
  170. package/template-vue-vite/dist-test-jsview-chunk/js/App.754fa30e.js +0 -776
  171. package/template-vue-vite/dist-test-jsview-chunk/js/App.7a63fc1e.js +0 -240
  172. package/template-vue-vite/dist-test-jsview-chunk/js/App.7b9d1275.js +0 -447
  173. package/template-vue-vite/dist-test-jsview-chunk/js/App.7bf78a71.js +0 -89
  174. package/template-vue-vite/dist-test-jsview-chunk/js/App.832753e3.js +0 -98
  175. package/template-vue-vite/dist-test-jsview-chunk/js/App.83b9bc1a.js +0 -194
  176. package/template-vue-vite/dist-test-jsview-chunk/js/App.8473b928.js +0 -568
  177. package/template-vue-vite/dist-test-jsview-chunk/js/App.85f0e26b.js +0 -1342
  178. package/template-vue-vite/dist-test-jsview-chunk/js/App.8e86826b.js +0 -502
  179. package/template-vue-vite/dist-test-jsview-chunk/js/App.94064c31.js +0 -104
  180. package/template-vue-vite/dist-test-jsview-chunk/js/App.9625268d.js +0 -173
  181. package/template-vue-vite/dist-test-jsview-chunk/js/App.96596f9f.js +0 -119
  182. package/template-vue-vite/dist-test-jsview-chunk/js/App.977c745b.js +0 -237
  183. package/template-vue-vite/dist-test-jsview-chunk/js/App.9e7fbf3c.js +0 -122
  184. package/template-vue-vite/dist-test-jsview-chunk/js/App.a059fc60.js +0 -676
  185. package/template-vue-vite/dist-test-jsview-chunk/js/App.a446bb49.js +0 -369
  186. package/template-vue-vite/dist-test-jsview-chunk/js/App.a485fc61.js +0 -139
  187. package/template-vue-vite/dist-test-jsview-chunk/js/App.a574bf96.js +0 -122
  188. package/template-vue-vite/dist-test-jsview-chunk/js/App.a58787a4.js +0 -225
  189. package/template-vue-vite/dist-test-jsview-chunk/js/App.a6e90b5c.js +0 -614
  190. package/template-vue-vite/dist-test-jsview-chunk/js/App.a6ef2ea5.js +0 -241
  191. package/template-vue-vite/dist-test-jsview-chunk/js/App.a82ae465.js +0 -119
  192. package/template-vue-vite/dist-test-jsview-chunk/js/App.ab97fadc.js +0 -306
  193. package/template-vue-vite/dist-test-jsview-chunk/js/App.b8d07d60.js +0 -68
  194. package/template-vue-vite/dist-test-jsview-chunk/js/App.ba82ae89.js +0 -731
  195. package/template-vue-vite/dist-test-jsview-chunk/js/App.c0fa704f.js +0 -181
  196. package/template-vue-vite/dist-test-jsview-chunk/js/App.ca457df6.js +0 -193
  197. package/template-vue-vite/dist-test-jsview-chunk/js/App.cab5b11a.js +0 -182
  198. package/template-vue-vite/dist-test-jsview-chunk/js/App.ceb70fcc.js +0 -395
  199. package/template-vue-vite/dist-test-jsview-chunk/js/App.d1955c7b.js +0 -139
  200. package/template-vue-vite/dist-test-jsview-chunk/js/App.d35f431e.js +0 -524
  201. package/template-vue-vite/dist-test-jsview-chunk/js/App.d434d1bc.js +0 -1201
  202. package/template-vue-vite/dist-test-jsview-chunk/js/App.d9ea2537.js +0 -172
  203. package/template-vue-vite/dist-test-jsview-chunk/js/App.dce9c295.js +0 -209
  204. package/template-vue-vite/dist-test-jsview-chunk/js/App.e06251fc.js +0 -157
  205. package/template-vue-vite/dist-test-jsview-chunk/js/App.e160a2dd.js +0 -587
  206. package/template-vue-vite/dist-test-jsview-chunk/js/App.e1d44beb.js +0 -198
  207. package/template-vue-vite/dist-test-jsview-chunk/js/App.e442e6e0.js +0 -611
  208. package/template-vue-vite/dist-test-jsview-chunk/js/App.e75db44d.js +0 -257
  209. package/template-vue-vite/dist-test-jsview-chunk/js/App.ebb89cc7.js +0 -97
  210. package/template-vue-vite/dist-test-jsview-chunk/js/App.f5f253ec.js +0 -143
  211. package/template-vue-vite/dist-test-jsview-chunk/js/App.f6a2ac1e.js +0 -251
  212. package/template-vue-vite/dist-test-jsview-chunk/js/App2.f586c86d.js +0 -112
  213. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserApic.64639b51.js +0 -112
  214. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserApic.vue.5e093f8c.js +0 -130
  215. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserApic2.8b0c8a0a.js +0 -106
  216. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserApic2.vue.7959bd77.js +0 -124
  217. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserApicLib.14ef44a9.js +0 -416
  218. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserAudio.28bef0de.js +0 -251
  219. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserAudio.vue.b874d583.js +0 -265
  220. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserJsvLatex.06fbda62.js +0 -100
  221. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserJsvLatex.vue.f0cdb016.js +0 -112
  222. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserJsvPlayer.a6858caf.js +0 -563
  223. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserJsvPlayer.vue.8615ee65.js +0 -575
  224. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserPreload.fe21457d.js +0 -139
  225. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserPreload.vue.23eda6fd.js +0 -146
  226. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserQrcode.727b4b8f.js +0 -175
  227. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserQrcode.vue.8e2b3454.js +0 -181
  228. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserSpray.b126f2ae.js +0 -57
  229. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserSpray.vue.52301a81.js +0 -70
  230. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserTextureAnim.e70349c2.js +0 -315
  231. package/template-vue-vite/dist-test-jsview-chunk/js/BrowserTextureAnim.vue.5426b5db.js +0 -327
  232. package/template-vue-vite/dist-test-jsview-chunk/js/DispersedItemSample.9696c982.js +0 -534
  233. package/template-vue-vite/dist-test-jsview-chunk/js/GifData.e5dd9fac.js +0 -429
  234. package/template-vue-vite/dist-test-jsview-chunk/js/Homepage.d8afeb55.js +0 -466
  235. package/template-vue-vite/dist-test-jsview-chunk/js/HorizontalButtonList.bbdbc725.js +0 -160
  236. package/template-vue-vite/dist-test-jsview-chunk/js/MainPage.cff1e89b.js +0 -57
  237. package/template-vue-vite/dist-test-jsview-chunk/js/SubPage.9633adf8.js +0 -59
  238. package/template-vue-vite/dist-test-jsview-chunk/js/app.config.92148fde.js +0 -18
  239. package/template-vue-vite/dist-test-jsview-chunk/js/export-sfc.2749ebea.js +0 -23
  240. package/template-vue-vite/dist-test-jsview-chunk/js/index.32520aa9.js +0 -938
  241. package/template-vue-vite/dist-test-jsview-chunk/js/index.56197146.js +0 -2892
  242. package/template-vue-vite/dist-test-jsview-chunk/js/index.f76869d4.js +0 -7522
  243. package/template-vue-vite/dist-test-jsview-chunk/js/jpegDemo.ff177df5.js +0 -7
  244. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-dom-browser.min.24b59670.js +0 -1913
  245. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-dom-entry.280f04b1.js +0 -76
  246. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-dom-native.min.0039079f.js +0 -1487
  247. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-engine-js-browser.min.f40edc22.js +0 -10684
  248. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-forge-define.bfab260e.js +0 -9
  249. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-forge-define.min.26efdcd1.js +0 -97
  250. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-loader.f9249ad3.js +0 -238
  251. package/template-vue-vite/dist-test-jsview-chunk/js/jsview-vue-entry.415721d8.js +0 -22233
  252. package/template-vue-vite/dist-test-jsview-chunk/js/jsview.config.a8cf302c.js +0 -49
  253. package/template-vue-vite/dist-test-jsview-chunk/js/main.bd759d7c.js +0 -565
  254. package/template-vue-vite/dist-test-jsview-chunk/js/main.jsv.51a0d4f8.mjs +0 -28
  255. package/template-vue-vite/dist-test-jsview-chunk/js/main.jsv.mjs +0 -28
  256. package/template-vue-vite/dist-test-jsview-chunk/js/permission.88de599e.js +0 -7
  257. package/template-vue-vite/dist-test-jsview-chunk/js/pngNoAlphaDemo.fbc58313.js +0 -7
  258. package/template-vue-vite/dist-test-jsview-chunk/js/vue.889a9b8b.js +0 -5382
  259. package/template-vue-vite/dist-test-jsview-chunk/jsv-info.json +0 -9
  260. package/template-vue-vite/dist-test-jsview-chunk/jsv-list.json +0 -248
@@ -1,2892 +0,0 @@
1
- import { F as Forge$1 } from "./jsview-forge-define.bfab260e.js";
2
- import { a as _export_sfc } from "./export-sfc.2749ebea.js";
3
- import { o as openBlock, e as createElementBlock, j as renderSlot, g as normalizeStyle, b as resolveComponent, k as createVNode, q as createCommentVNode } from "./vue.889a9b8b.js";
4
- const forgeEvtTypeRef = Forge$1.FreeMoveActEvtType;
5
- ({
6
- ActFinish: forgeEvtTypeRef.ActEvent_ActFinish,
7
- SpeedRevertX: forgeEvtTypeRef.ActEvent_Speed_X_Revert,
8
- SpeedRevertY: forgeEvtTypeRef.ActEvent_Speed_Y_Revert,
9
- ActReject: forgeEvtTypeRef.ActEvent_ActReject
10
- // 当动作不可能完成,会回调此事件
11
- });
12
- Forge$1.FreeMoveExternType?.GroupType_ActionAssoc;
13
- Forge$1.FreeMoveExternType?.GroupType_Invalid;
14
- Forge$1.FreeMoveConditionSet;
15
- Forge$1.FreeMoveStateBuilder;
16
- Forge$1.FreeMoveActionBuilder;
17
- Forge$1.FreeMoveCmdPackBuilder;
18
- Forge$1.FreeMoveAnimation;
19
- Forge$1.AnimFireCommand.RunFreeMoveCmdPacks;
20
- Forge$1.sRenderBridge.FinishRenderBreak.bind(Forge$1.sRenderBridge);
21
- let PluginInfo$2 = {
22
- // downloadUrl:"http://192.168.0.101:8080/plugin/JsvPlayer-214.zip", //插件下载地址
23
- packageName: "com.qcode.jsvplayer",
24
- name: "播放器插件",
25
- version: "2.1.4",
26
- //插件需要的版本号
27
- versionCodeMin: 214,
28
- versionCodeMax: 214,
29
- bridgeName: "jsvPlayerBridge",
30
- //插件bridge注册到jsview的名称
31
- className: "com.qcode.jsvplayer.JsvPlayer",
32
- //插件初始化类名称
33
- initMethod: "createInstance",
34
- //插件初始化方法
35
- listener: "top.JsvPlayerPluginLoadResult",
36
- //插件加载结果回调
37
- listener2: "top.JsvPlayerPluginStatus",
38
- // debug:true,
39
- md5: "6443d073696fe73818ca7b7d19b3591c"
40
- };
41
- function reconfigPluginInfo() {
42
- if (typeof window.jJsvRuntimeBridge !== "undefined" && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
43
- let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
44
- if (plugin_base_url) {
45
- PluginInfo$2.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : plugin_base_url + "/") + PluginInfo$2.packageName + "/JsvPlayer-" + PluginInfo$2.versionCodeMax + ".dat?md5=" + PluginInfo$2.md5;
46
- }
47
- }
48
- }
49
- reconfigPluginInfo();
50
- function getPluginInfo() {
51
- return PluginInfo$2;
52
- }
53
- let EVENT_STATUS_NONE = 0;
54
- let EVENT_STATUS_LOADSTART = 1;
55
- let EVENT_STATUS_LOAD = 2;
56
- let EVENT_STATUS_SEEK = 3;
57
- let EVENT_STATUS_SEEKED = 4;
58
- let EVENT_STATUS_STALLED = 5;
59
- let EVENT_STATUS_RESUME = 6;
60
- let EVENT_STATUS_DISPLAY = 7;
61
- let EVENT_STATUS_TIMESHIFT = 8;
62
- let EVENT_STATUS_TIMESHIFTED = 9;
63
- let EVENT_STATUS_BACKLIVE = 10;
64
- let EVENT_STATUS_BACKLIVED = 11;
65
- let EVENT_STATUS_END = 12;
66
- let MediaPluginInfo = getPluginInfo();
67
- var mediaArray = [];
68
- var pluginLoadListener = [];
69
- var PluginEventKey = "JsvPlayer";
70
- var chipType = "";
71
- let LOG_LEVEL_FATAL = 5;
72
- let LOG_LEVEL_ERROR = 4;
73
- let LOG_LEVEL_WARNING = 3;
74
- let LOG_LEVEL_DEBUG = 2;
75
- let LOG_LEVEL_TRACE = 1;
76
- let LogLevel = LOG_LEVEL_TRACE;
77
- function logPrint(level, message) {
78
- if (level >= LogLevel) {
79
- console.log(message);
80
- }
81
- }
82
- function logFatal(message) {
83
- logPrint(LOG_LEVEL_FATAL, message);
84
- }
85
- function logError(message) {
86
- logPrint(LOG_LEVEL_ERROR, message);
87
- }
88
- function logWarning$1(message) {
89
- logPrint(LOG_LEVEL_WARNING, message);
90
- }
91
- function logDebug(message) {
92
- logPrint(LOG_LEVEL_DEBUG, message);
93
- }
94
- function logTrace(message) {
95
- logPrint(LOG_LEVEL_TRACE, message);
96
- }
97
- var PLUGIN_EVENT_STATUS_START_LOAD = 1;
98
- var PLUGIN_EVENT_STATUS_DOWNLOAD = 2;
99
- var PLUGIN_EVENT_STATUS_UNZIPED = 3;
100
- var PLUGIN_EVENT_STATUS_DEXLOADED = 4;
101
- var PLUGIN_EVENT_STATUS_COMPLETE = 5;
102
- var pluginLoadState = 0;
103
- function JsvPlayerPluginStatus(status) {
104
- logDebug("JsvPlayerPluginStatus: " + status);
105
- let ret = JSON.parse(status);
106
- let notify_obj = {};
107
- notify_obj.status = 1;
108
- if (ret && ret.first_load) {
109
- pluginLoadState = 3;
110
- notify_obj.code = 1;
111
- } else {
112
- pluginLoadState = 2;
113
- notify_obj.code = 2;
114
- }
115
- for (let i = 0; i < pluginLoadListener.length; i++) {
116
- pluginLoadListener[i](notify_obj);
117
- }
118
- }
119
- window.top.JsvPlayerPluginStatus = function(status) {
120
- JsvPlayerPluginStatus(status);
121
- };
122
- function JsvPlayerPluginLoadResult(result) {
123
- logDebug("JsvPlayerPluginLoadResult: " + result);
124
- var ret_obj = JSON.parse(result);
125
- let notify_obj = {};
126
- if (ret_obj && (ret_obj.status === 5 || ret_obj.status === 1)) {
127
- pluginLoadState = 4;
128
- notify_obj.status = 3;
129
- notify_obj.code = 0;
130
- } else if (ret_obj && ret_obj.status === -12) {
131
- pluginLoadState = 5;
132
- notify_obj.status = 4;
133
- notify_obj.code = ret_obj.status;
134
- } else {
135
- pluginLoadState = 5;
136
- notify_obj.status = 4;
137
- if (ret_obj) {
138
- notify_obj.code = ret_obj.status;
139
- } else {
140
- notify_obj.code = -1;
141
- }
142
- }
143
- if (pluginLoadState === 5) {
144
- logFatal("*************************JsvPlayer plugin load failed, error code is " + ret_obj.status + "*************************");
145
- }
146
- UnregisterJsvPlayerPluginEvent();
147
- if (pluginLoadState === 4) {
148
- let capabilitySet = getJsvPlayerCapabilitySet();
149
- if (capabilitySet !== null && capabilitySet !== "") {
150
- let capabilitySetObj = JSON.parse(capabilitySet);
151
- if (capabilitySetObj !== null && capabilitySetObj.hasOwnProperty("chipType")) {
152
- chipType = capabilitySetObj.chipType;
153
- }
154
- }
155
- }
156
- for (let i = 0; i < mediaArray.length; i++) {
157
- mediaArray[i].buildPlatformInstance();
158
- }
159
- for (let i = 0; i < pluginLoadListener.length; i++) {
160
- pluginLoadListener[i](notify_obj);
161
- }
162
- }
163
- window.top.JsvPlayerPluginLoadResult = function(result) {
164
- JsvPlayerPluginLoadResult(result);
165
- };
166
- window.top.CreatePlayerResult = function(result) {
167
- logDebug("CreatePlayerResult: " + result);
168
- let result_obj = JSON.parse(result);
169
- if (result_obj.code == 0) {
170
- for (var i = 0; i < mediaArray.length; i++) {
171
- if (mediaArray[i].key === result_obj.key) {
172
- mediaArray[i].initPlayer();
173
- break;
174
- }
175
- }
176
- } else {
177
- logError("Create player failed, key=" + result_obj.key);
178
- }
179
- }.bind(globalThis);
180
- function JsvPlayerPluginEvent(data) {
181
- console.log("LoadPlugin2 result: " + data);
182
- let obj = JSON.parse(data);
183
- let event_obj = JSON.parse(obj.param);
184
- if (event_obj.hasOwnProperty("status")) {
185
- let status = event_obj.status;
186
- let notify_obj = {};
187
- switch (status) {
188
- case PLUGIN_EVENT_STATUS_START_LOAD:
189
- {
190
- let code = 1;
191
- if (event_obj.hasOwnProperty("code")) {
192
- code = event_obj.code;
193
- }
194
- notify_obj.status = 1;
195
- notify_obj.code = code;
196
- if (code === 1) {
197
- pluginLoadState = 3;
198
- } else {
199
- pluginLoadState = 2;
200
- }
201
- }
202
- break;
203
- case PLUGIN_EVENT_STATUS_DOWNLOAD:
204
- notify_obj.status = 2;
205
- notify_obj.code = 1;
206
- notify_obj.progress = 100;
207
- break;
208
- case PLUGIN_EVENT_STATUS_UNZIPED:
209
- notify_obj.status = 2;
210
- notify_obj.code = 2;
211
- break;
212
- case PLUGIN_EVENT_STATUS_DEXLOADED:
213
- notify_obj.status = 2;
214
- notify_obj.code = 3;
215
- break;
216
- case PLUGIN_EVENT_STATUS_COMPLETE:
217
- {
218
- let code = 0;
219
- if (event_obj.hasOwnProperty("code")) {
220
- code = event_obj.code;
221
- }
222
- if (code === 0) {
223
- notify_obj.status = 3;
224
- notify_obj.code = 0;
225
- pluginLoadState = 4;
226
- } else {
227
- notify_obj.status = 4;
228
- notify_obj.code = code;
229
- pluginLoadState = 5;
230
- }
231
- UnregisterJsvPlayerPluginEvent();
232
- }
233
- break;
234
- default:
235
- logWarning$1("Load plugin status, invalid status: " + status);
236
- return;
237
- }
238
- for (let i = 0; i < pluginLoadListener.length; i++) {
239
- pluginLoadListener[i](notify_obj);
240
- }
241
- if (pluginLoadState === 4) {
242
- let capabilitySet = getJsvPlayerCapabilitySet();
243
- if (capabilitySet !== null && capabilitySet !== "") {
244
- let capabilitySetObj = JSON.parse(capabilitySet);
245
- if (capabilitySetObj !== null && capabilitySetObj.hasOwnProperty("chipType")) {
246
- chipType = capabilitySetObj.chipType;
247
- }
248
- }
249
- for (let i = 0; i < mediaArray.length; i++) {
250
- mediaArray[i].buildPlatformInstance();
251
- }
252
- }
253
- } else {
254
- let type = event_obj.type;
255
- let param = event_obj.param;
256
- if (type === 1) {
257
- JsvPlayerPluginStatus(param);
258
- } else if (type === 2) {
259
- JsvPlayerPluginLoadResult(param);
260
- } else {
261
- logError("Invalid type: " + type);
262
- }
263
- }
264
- }
265
- function RegisterJsvPlayerPluginEvent() {
266
- window.JMD.subscribe(PluginEventKey, JsvPlayerPluginEvent);
267
- }
268
- function UnregisterJsvPlayerPluginEvent() {
269
- window.JMD.unsubscribe(PluginEventKey, JsvPlayerPluginEvent);
270
- }
271
- function globalLoadJsvPlayerPlugin(listener) {
272
- logDebug("globalLoadJsvPlayerPlugin");
273
- let notify_obj = {};
274
- if (typeof window.jPluginManagerBridge === "undefined" || !window.jPluginManagerBridge) {
275
- notify_obj.status = 4;
276
- notify_obj.code = 1;
277
- } else if (pluginLoadState === 2) {
278
- notify_obj.status = 1;
279
- notify_obj.code = 2;
280
- } else if (pluginLoadState === 3) {
281
- notify_obj.status = 1;
282
- notify_obj.code = 1;
283
- } else if (pluginLoadState === 4) {
284
- notify_obj.status = 3;
285
- notify_obj.code = 0;
286
- }
287
- if (notify_obj.hasOwnProperty("status")) {
288
- if (typeof listener !== "undefined" && listener) {
289
- setTimeout(() => {
290
- listener(notify_obj);
291
- }, 0);
292
- }
293
- }
294
- if (pluginLoadState === 4 || typeof window.jPluginManagerBridge === "undefined" || !window.jPluginManagerBridge) {
295
- return;
296
- } else if (pluginLoadState === 5) {
297
- pluginLoadState = 0;
298
- }
299
- if (typeof listener !== "undefined" && listener) {
300
- pluginLoadListener.push(listener);
301
- }
302
- if (pluginLoadState > 0) {
303
- return;
304
- }
305
- pluginLoadState = 1;
306
- RegisterJsvPlayerPluginEvent();
307
- if (typeof window.jPluginManagerBridge.LoadPlugin2 !== "undefined") {
308
- window.jPluginManagerBridge.LoadPlugin2(PluginEventKey, JSON.stringify(MediaPluginInfo));
309
- } else {
310
- window.jPluginManagerBridge.LoadPlugin(JSON.stringify(MediaPluginInfo));
311
- }
312
- }
313
- function findMediaObjectByKey(key) {
314
- for (var i = 0; i < mediaArray.length; i++) {
315
- if (mediaArray[i].key === key) {
316
- return mediaArray[i];
317
- }
318
- }
319
- return null;
320
- }
321
- class JsvBaseMedia {
322
- constructor(type, window_mode, hole_id, player_type, key, background, design_map_width, decode_type) {
323
- logTrace("Create JsvBaseMedia, type=" + type + ", hole_id=" + hole_id + ", player_type=" + player_type + ", key=" + key + ", background=" + background + ", design_map_width=" + design_map_width + ", decode_type=" + decode_type);
324
- this.state = {
325
- muted: false,
326
- paused: true,
327
- repeat: false,
328
- enablePlayer: false,
329
- autoplay: false,
330
- startTime: 0,
331
- currentTime: 0,
332
- aspectRatio: "origin",
333
- keepLastFrame: true,
334
- timeUpdateLess: false,
335
- rate: 1,
336
- volume: 1,
337
- chromaKey: null,
338
- audioTrack: -1
339
- };
340
- this.local = {
341
- currentTime: 0,
342
- playableDuration: 0,
343
- duration: 0,
344
- isRenderable: false,
345
- paused: true
346
- };
347
- this.type = type;
348
- this.playerCreate = false;
349
- this.key = key;
350
- this.windowMode = window_mode;
351
- this.background = background;
352
- this.holeId = hole_id;
353
- this.holeIdModify = hole_id;
354
- this.playerType = player_type;
355
- this.designMapWidth = design_map_width;
356
- this.decodeType = decode_type;
357
- this.channelID = -1;
358
- this.ref = 1;
359
- this.appVisible = window.JsView && window.JsView.getVisibility ? window.JsView.getVisibility() === "show" : true;
360
- this.eventReport = true;
361
- this.currentEventStatus = EVENT_STATUS_NONE;
362
- this.frameRateLimit = false;
363
- this._onEvent = this.onEvent.bind(this);
364
- this._onVisibilityChangeCallBack = this.onVisibilityChangeCallBack.bind(this);
365
- let found = false;
366
- for (let i = 0; i < mediaArray.length; i++) {
367
- if (mediaArray[i].key === this.key) {
368
- found = true;
369
- break;
370
- }
371
- }
372
- if (!found) {
373
- mediaArray.push(this);
374
- }
375
- if (typeof window.jsvPlayerBridge == "undefined" || !window.jsvPlayerBridge) {
376
- globalLoadJsvPlayerPlugin();
377
- } else {
378
- this.buildPlatformInstance();
379
- }
380
- }
381
- /**
382
- * 私有接口,外部不需要调用此接口。
383
- */
384
- buildPlatformInstance() {
385
- logTrace("buildPlatformInstance, key=" + this.key);
386
- if (typeof window.jsvPlayerBridge == "undefined" || !window.jsvPlayerBridge) {
387
- logError("no jsvPlayerBridge");
388
- return;
389
- }
390
- let share_view = true;
391
- window.jsvPlayerBridge.CreatePlayer2(this.key, this.windowMode, this.holeId, this.background, this.designMapWidth, share_view, this.playerType, this.decodeType).then(
392
- (result) => {
393
- logDebug("CreatePlayerResult: " + result);
394
- let result_obj = JSON.parse(result);
395
- if (result_obj.code == 0) {
396
- for (var i = 0; i < mediaArray.length; i++) {
397
- if (mediaArray[i].key === result_obj.key) {
398
- mediaArray[i].initPlayer();
399
- break;
400
- }
401
- }
402
- } else {
403
- logError("Create player failed, key=" + result_obj.key);
404
- }
405
- },
406
- (data) => {
407
- logError("Create player failed, reject(" + data + ")");
408
- }
409
- );
410
- }
411
- /**
412
- * 私有接口,外部不需要调用此接口。
413
- */
414
- initPlayer() {
415
- if (this.playerCreate)
416
- return;
417
- logDebug("InitPlayer:1, key=" + this.key);
418
- this.playerCreate = true;
419
- window.JMD.subscribe(this.key, this._onEvent);
420
- if (window.JsView && window.JsView.onVisibilityChange) {
421
- logDebug("playerKey: " + this.key + ", onVisibilityChange register");
422
- window.JsView.onVisibilityChange(this._onVisibilityChangeCallBack);
423
- }
424
- if (this.holeIdModify !== this.holeId) {
425
- window.jsvPlayerBridge.setHoleID(this.key, this.holeIdModify);
426
- this.holeId = this.holeIdModify;
427
- }
428
- this.appVisible = window.JsView && window.JsView.getVisibility ? window.JsView.getVisibility() === "show" : true;
429
- if (this.appVisible) {
430
- this.initParams();
431
- }
432
- }
433
- initParams() {
434
- logDebug("InitPlayer:2, key=" + this.key);
435
- if (this.channelID >= 0) {
436
- this.joinChannelPrivate(this.channelID);
437
- } else if (this.state["src"]) {
438
- this.setState("src", this.state["src"], "string");
439
- if (this.state["currentTime"]) {
440
- this.setState("currentTime", this.state["currentTime"], "number");
441
- } else if (this.state["startTime"]) {
442
- this.setState("startTime", this.state["startTime"], "number");
443
- }
444
- }
445
- if (this.state["paused"] == false) {
446
- this.setState("paused", this.state["paused"], "boolean");
447
- }
448
- if (this.state["autoplay"]) {
449
- this.setState("autoplay", this.state["autoplay"], "boolean");
450
- }
451
- if (this.state["repeat"]) {
452
- this.setState("repeat", this.state["repeat"], "boolean");
453
- }
454
- if (this.state["muted"]) {
455
- this.setState("muted", this.state["muted"], "boolean");
456
- }
457
- if (this.state["timeUpdateLess"]) {
458
- this.setState("timeUpdateLess", this.state["timeUpdateLess"], "boolean");
459
- }
460
- if (this.state["keepLastFrame"] == false) {
461
- this.setState("keepLastFrame", this.state["keepLastFrame"], "boolean");
462
- }
463
- if (this.state["aspectRatio"] !== "origin") {
464
- this.setState("aspectRatio", this.state["aspectRatio"], "string");
465
- }
466
- if (this.state["chromaKey"]) {
467
- this.setState("chromaKey", this.state["chromaKey"], "string");
468
- }
469
- if (this.state["audioTrack"] !== -1) {
470
- this.setState("audioTrack", this.state["audioTrack"], "number");
471
- }
472
- }
473
- onVisibilityChangeCallBack() {
474
- let visible = window.JsView && window.JsView.getVisibility ? window.JsView.getVisibility() === "show" : true;
475
- this.setVisibility(visible);
476
- }
477
- /**
478
- * 设置可见状态,在可见状态发生变化时,释放或者启动流。
479
- * @param {boolean} visible true:可见,false,不可见。
480
- */
481
- setVisibility(visible) {
482
- logDebug("playerKey:" + this.key + ", 小程序可见状态: " + visible);
483
- if (typeof visible !== "boolean") {
484
- logError("playerKey:" + this.key + ", setVisibility, param type is invalid");
485
- return;
486
- }
487
- if (visible === this.appVisible) {
488
- logDebug("playerKey:" + this.key + ", 小程序可见状态未发生变化,不执行动作");
489
- return;
490
- }
491
- if (visible) {
492
- this.appVisible = visible;
493
- this.state.paused = this.local.paused;
494
- this.state.currentTime = this.local.currentTime;
495
- logDebug("currentTime: " + this.state.currentTime);
496
- this.initParams();
497
- } else {
498
- logDebug("playerKey:" + this.key + ", playerCreate: " + this.playerCreate + ", channelID: " + this.channelID + ", src: " + this.state["src"]);
499
- if (this.playerCreate) {
500
- this.eventReport = false;
501
- if (this.channelID > 0) {
502
- logDebug("leaveChannel");
503
- window.jsvPlayerBridge.leaveChannel(this.key);
504
- } else if (this.state["src"]) {
505
- logDebug("unload");
506
- this.local.currentTime = this.currentTime;
507
- this.local.paused = this.paused;
508
- logDebug("currentTime: " + this.local.currentTime);
509
- this.unloadPrivate();
510
- }
511
- }
512
- this.appVisible = visible;
513
- }
514
- }
515
- /**
516
- * 当使用一个已有的Media对象时,需要通过这个接口追加一个ref,在调用releasePlayer接口释放时,会ref--,当ref==0才真正释放播放器实例。
517
- */
518
- setRef() {
519
- this.ref++;
520
- }
521
- /**
522
- * 释放播放器,一般不需要应用逻辑调用,在JsvPlayer高阶组件unmounted处理时调用此接口释放。
523
- */
524
- releasePlayer() {
525
- logTrace("releasePlayer, key=" + this.key + ", ref=" + this.ref);
526
- this.ref--;
527
- if (this.ref === 0) {
528
- if (typeof window.jsvPlayerBridge != "undefined" && window.jsvPlayerBridge) {
529
- this.changeFrameRate(false);
530
- window.JMD.unsubscribe(this.key, this._onEvent);
531
- window.jsvPlayerBridge.ReleasePlayer(this.key);
532
- if (window.JsView && window.JsView.removeEventCallback) {
533
- logDebug("playerKey: " + this.key + ", onVisibilityChange unregister");
534
- window.JsView.removeEventCallback(this._onVisibilityChangeCallBack);
535
- }
536
- }
537
- for (let i = 0; i < mediaArray.length; i++) {
538
- if (mediaArray[i].key === this.key) {
539
- mediaArray.splice(i, 1);
540
- break;
541
- }
542
- }
543
- }
544
- }
545
- setHoleID(hole_id) {
546
- logTrace("setHoleID, key=" + this.key + ", hole_id=" + hole_id);
547
- if (this.playerCreate) {
548
- this.holeId = hole_id;
549
- this.holeIdModify = hole_id;
550
- window.jsvPlayerBridge.setHoleID(this.key, hole_id);
551
- } else {
552
- this.holeIdModify = hole_id;
553
- }
554
- }
555
- /**
556
- * 当full模式且播放器模式是2(jsvplayer),如果是H2芯片,需要修改动画帧率到30帧,否则会导致播放器音画不同步。
557
- * @param {boolean} enable 开关,视频起播时打开;视频停止,或者播放器释放时,关闭。
558
- */
559
- changeFrameRate(enable) {
560
- if (this.windowMode === "full" && this.playerType === 2 && chipType === "allwinnerh2") {
561
- if (this.frameRateLimit != enable) {
562
- logDebug("changeFrameRate, key=" + this.key + ", enable=" + enable);
563
- this.frameRateLimit = enable;
564
- if (enable) {
565
- window.JsView?.reduceFps?.(30);
566
- } else {
567
- window.JsView?.reduceFps?.(0);
568
- }
569
- }
570
- }
571
- }
572
- needReportEvent(event) {
573
- let ret = true;
574
- if (!this.eventReport) {
575
- ret = false;
576
- switch (this.currentEventStatus) {
577
- case EVENT_STATUS_NONE:
578
- this.eventReport = true;
579
- ret = true;
580
- break;
581
- case EVENT_STATUS_LOADSTART:
582
- if (event == EVENT_STATUS_LOADSTART || event == EVENT_STATUS_LOAD || event == EVENT_STATUS_DISPLAY || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_TIMESHIFTED) {
583
- this.eventReport = true;
584
- }
585
- if (event == EVENT_STATUS_LOADSTART) {
586
- ret = false;
587
- } else {
588
- ret = true;
589
- }
590
- break;
591
- case EVENT_STATUS_LOAD:
592
- if (event == EVENT_STATUS_LOAD || event == EVENT_STATUS_DISPLAY || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_TIMESHIFTED) {
593
- this.eventReport = true;
594
- }
595
- if (event == EVENT_STATUS_LOADSTART || event == EVENT_STATUS_LOAD) {
596
- ret = false;
597
- } else {
598
- ret = true;
599
- }
600
- break;
601
- case EVENT_STATUS_DISPLAY:
602
- if (event == EVENT_STATUS_DISPLAY || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_TIMESHIFTED) {
603
- this.eventReport = true;
604
- }
605
- if (event != EVENT_STATUS_END) {
606
- ret = false;
607
- } else {
608
- ret = true;
609
- }
610
- break;
611
- case EVENT_STATUS_TIMESHIFT:
612
- if (event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY) {
613
- this.eventReport = true;
614
- }
615
- if (event == EVENT_STATUS_TIMESHIFT) {
616
- ret = false;
617
- } else {
618
- ret = true;
619
- }
620
- break;
621
- case EVENT_STATUS_TIMESHIFTED:
622
- if (event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY) {
623
- this.eventReport = true;
624
- }
625
- if (event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_TIMESHIFTED) {
626
- ret = false;
627
- } else {
628
- ret = true;
629
- }
630
- break;
631
- case EVENT_STATUS_BACKLIVE:
632
- if (event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY) {
633
- this.eventReport = true;
634
- }
635
- if (event == EVENT_STATUS_BACKLIVE) {
636
- ret = false;
637
- } else {
638
- ret = true;
639
- }
640
- break;
641
- case EVENT_STATUS_BACKLIVED:
642
- if (event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY) {
643
- this.eventReport = true;
644
- }
645
- if (event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED) {
646
- ret = false;
647
- } else {
648
- ret = true;
649
- }
650
- break;
651
- case EVENT_STATUS_END:
652
- this.eventReport = true;
653
- ret = true;
654
- break;
655
- default:
656
- logWarning$1("current event status is " + this.currentEventStatus);
657
- this.eventReport = true;
658
- ret = true;
659
- break;
660
- }
661
- logTrace("eventReport:" + this.eventReport + ", ret=" + ret);
662
- }
663
- return ret;
664
- }
665
- /**
666
- * 私有接口,外部不需要调用此接口。
667
- */
668
- onEvent(event_str) {
669
- logTrace("player event: " + event_str);
670
- let obj = JSON.parse(event_str);
671
- let event_obj = JSON.parse(obj.param);
672
- let event = event_obj.event;
673
- let data = event_obj.data;
674
- switch (event) {
675
- case "onProgress":
676
- {
677
- if (this.local.isRenderable == false) {
678
- return;
679
- }
680
- let time_update = this.local.currentTime != data.currentTime;
681
- this.local.currentTime = data.currentTime;
682
- if (time_update && this.hasOwnProperty("ontimeupdate")) {
683
- this["ontimeupdate"](data.currentTime);
684
- }
685
- let progress_update = this.local.playableDuration != data.playableDuration;
686
- this.local.playableDuration = data.playableDuration;
687
- if (progress_update && this.hasOwnProperty("onprogress")) {
688
- this["onprogress"]();
689
- }
690
- let canplay_through = this.local.playableDuration == this.local.duration;
691
- if (canplay_through && progress_update && this.hasOwnProperty("oncanplaythrough")) {
692
- this["oncanplaythrough"]();
693
- }
694
- }
695
- break;
696
- case "onEnd":
697
- if (this.needReportEvent(EVENT_STATUS_END)) {
698
- this.local.isRenderable = false;
699
- this.setState("paused", true, "boolean");
700
- if (this.hasOwnProperty("onend")) {
701
- this["onend"]();
702
- }
703
- this.currentEventStatus = EVENT_STATUS_END;
704
- }
705
- break;
706
- case "onLoadStart":
707
- logDebug("onLoadStart:" + data);
708
- if (this.needReportEvent(EVENT_STATUS_LOADSTART)) {
709
- if (this.hasOwnProperty("onloadstart")) {
710
- this["onloadstart"]();
711
- }
712
- this.currentEventStatus = EVENT_STATUS_LOADSTART;
713
- }
714
- break;
715
- case "onLoad":
716
- logDebug("onLoad:" + data);
717
- if (this.needReportEvent(EVENT_STATUS_LOAD)) {
718
- this.local.currentTime = data.currentTime;
719
- this.local.duration = data.duration;
720
- if (this.hasOwnProperty("onloadedmetadata")) {
721
- this["onloadedmetadata"]();
722
- }
723
- if (this.hasOwnProperty("onload")) {
724
- this["onload"]();
725
- }
726
- if (this.hasOwnProperty("ondurationchange")) {
727
- this["ondurationchange"]();
728
- }
729
- this.currentEventStatus = EVENT_STATUS_LOAD;
730
- }
731
- break;
732
- case "onError":
733
- logDebug("onError:" + data);
734
- this.local.isRenderable = false;
735
- if (this.hasOwnProperty("onerror")) {
736
- const Error = {
737
- MEDIA_ERR_ABORTED: 1,
738
- MEDIA_ERR_NETWORK: 2,
739
- MEDIA_ERR_DECODE: 3,
740
- MEDIA_ERR_SRC_NOT_SUPPORTED: 4,
741
- MEDIA_ERR_ONLY_ONE_4K: 5,
742
- MEDIA_ERR_NO_DECODE_RESOURCE: 6
743
- };
744
- const platform_error = data.error.what;
745
- let e = Error.MEDIA_ERR_ABORTED;
746
- switch (platform_error) {
747
- case -1004:
748
- e = Error.MEDIA_ERR_NETWORK;
749
- break;
750
- case -1007:
751
- e = Error.MEDIA_ERR_DECODE;
752
- break;
753
- case -1010:
754
- e = Error.MEDIA_ERR_SRC_NOT_SUPPORTED;
755
- break;
756
- case -50001:
757
- e = Error.MEDIA_ERR_ONLY_ONE_4K;
758
- break;
759
- case -50002:
760
- e = Error.MEDIA_ERR_NO_DECODE_RESOURCE;
761
- break;
762
- }
763
- this["onerror"](e);
764
- }
765
- break;
766
- case "onSeek":
767
- logDebug("onSeek:" + data);
768
- if (this.needReportEvent(EVENT_STATUS_SEEK)) {
769
- this.local.isRenderable = false;
770
- if (this.hasOwnProperty("onseeking")) {
771
- this["onseeking"]();
772
- }
773
- }
774
- break;
775
- case "onEventExt":
776
- logDebug("onEventExt:" + data);
777
- switch (data.eventExt) {
778
- case "videoMetadataUpdate":
779
- if (this.hasOwnProperty("onloadedmetadata")) {
780
- this["onloadedmetadata"]();
781
- }
782
- break;
783
- case "videoSeekComplete":
784
- if (this.needReportEvent(EVENT_STATUS_SEEKED)) {
785
- if (this.hasOwnProperty("onseeked")) {
786
- this["onseeked"]();
787
- }
788
- }
789
- break;
790
- default:
791
- logWarning$1("unimplentation event ext type = " + data.eventExt);
792
- break;
793
- }
794
- break;
795
- case "onAudioFocusGain":
796
- logDebug("onAudioFocusGain:" + data);
797
- if (this.hasOwnProperty("onaudiofocusgain")) {
798
- this["onaudiofocusgain"](data);
799
- }
800
- break;
801
- case "onAudioFocusLoss":
802
- logDebug("onAudioFocusLoss:" + data);
803
- if (this.hasOwnProperty("onaudiofocusloss")) {
804
- this["onaudiofocusloss"](data);
805
- }
806
- break;
807
- case "onPlaybackStalled":
808
- if (this.needReportEvent(EVENT_STATUS_STALLED)) {
809
- this.local.isRenderable = false;
810
- if (this.hasOwnProperty("onstalled")) {
811
- this["onstalled"]();
812
- }
813
- }
814
- break;
815
- case "onPlaybackResume":
816
- if (this.needReportEvent(EVENT_STATUS_RESUME)) {
817
- this.local.isRenderable = true;
818
- if (this.hasOwnProperty("onplaying")) {
819
- this["onplaying"]();
820
- }
821
- }
822
- break;
823
- case "onReadyForDisplay":
824
- this.changeFrameRate(true);
825
- if (this.needReportEvent(EVENT_STATUS_DISPLAY)) {
826
- this.local.isRenderable = true;
827
- if (this.hasOwnProperty("oncanplay")) {
828
- this["oncanplay"]();
829
- }
830
- this.currentEventStatus = EVENT_STATUS_DISPLAY;
831
- }
832
- break;
833
- case "onTimeShift":
834
- logDebug("onTimeShift");
835
- if (this.needReportEvent(EVENT_STATUS_TIMESHIFT)) {
836
- if (this.hasOwnProperty("ontimeshift")) {
837
- this["ontimeshift"](data.seekTime);
838
- }
839
- this.currentEventStatus = EVENT_STATUS_TIMESHIFT;
840
- }
841
- break;
842
- case "onTimeShifted":
843
- logDebug("onTimeShifted");
844
- if (this.needReportEvent(EVENT_STATUS_TIMESHIFTED)) {
845
- if (this.hasOwnProperty("ontimeshifted")) {
846
- this["ontimeshifted"]();
847
- }
848
- this.currentEventStatus = EVENT_STATUS_TIMESHIFTED;
849
- }
850
- break;
851
- case "onBackLive":
852
- logDebug("onBackLive");
853
- if (this.needReportEvent(EVENT_STATUS_BACKLIVE)) {
854
- if (this.hasOwnProperty("onbacklive")) {
855
- this["onbacklive"]();
856
- }
857
- this.currentEventStatus = EVENT_STATUS_BACKLIVE;
858
- }
859
- break;
860
- case "onBackLived":
861
- logDebug("onBackLived");
862
- if (this.needReportEvent(EVENT_STATUS_BACKLIVED)) {
863
- if (this.hasOwnProperty("onbacklived")) {
864
- this["onbacklived"]();
865
- }
866
- this.currentEventStatus = EVENT_STATUS_BACKLIVED;
867
- }
868
- break;
869
- }
870
- }
871
- /**
872
- * 属性,boolean类型,不支持读取,true表示自动播放。
873
- */
874
- set autoplay(value) {
875
- this.setState("autoplay", value, "boolean");
876
- }
877
- /**
878
- * 属性,double类型,当前时间,单位秒,set用于seek操作(起播后)或者设置起播时间(起播前),get用于读取当前时间。
879
- */
880
- get currentTime() {
881
- if (!this.appVisible) {
882
- return this.local.currentTime;
883
- }
884
- let result = this.getProperty("currentTime");
885
- if (result != null) {
886
- this.local.currentTime = result;
887
- return result;
888
- }
889
- return 0;
890
- }
891
- set currentTime(value) {
892
- this.local.isRenderable = false;
893
- this.local.currentTime = value;
894
- this.setState("currentTime", value, "number");
895
- }
896
- /**
897
- * 属性,double类型,总时长,单位秒,只支持读取。
898
- */
899
- get duration() {
900
- if (!this.appVisible) {
901
- return this.local.duration;
902
- }
903
- let result = this.getProperty("duration");
904
- if (result != null)
905
- return result;
906
- return 0;
907
- }
908
- /**
909
- * 属性,boolean类型,不支持读取,true表示循环播放。
910
- */
911
- set loop(value) {
912
- if (typeof value == "boolean") {
913
- this.setState("repeat", value, "boolean");
914
- } else if (typeof value == "undefined") {
915
- this.setState("repeat", false, "boolean");
916
- } else {
917
- this.setState("repeat", true, "boolean");
918
- }
919
- }
920
- /**
921
- * 属性,boolean类型,设置和获取静音状态。
922
- */
923
- get muted() {
924
- return this.getState("muted");
925
- }
926
- set muted(value) {
927
- this.setState("muted", value, "boolean");
928
- }
929
- /**
930
- * 属性,boolean类型,当前pause状态,只支持读取。
931
- */
932
- get paused() {
933
- return this.getState("paused");
934
- }
935
- /**
936
- * 属性,float类型,设置或者读取倍速播放,通常的值是0.5、0.75、1.0、1.25、1.5、2.0、3.0。
937
- */
938
- get playbackRate() {
939
- return this.getState("rate");
940
- }
941
- set playbackRate(value) {
942
- logDebug("playbackRate");
943
- this.setState("rate", value, "number");
944
- }
945
- /**
946
- * 已废弃。
947
- */
948
- get preload() {
949
- return this.enablePlayer ? "auto" : "none";
950
- }
951
- set preload(value) {
952
- if (value !== "none") {
953
- this.load();
954
- }
955
- }
956
- /**
957
- * 属性,string类型,播放地址,不支持读取。
958
- */
959
- set src(value) {
960
- this.setSrc(value, null, null, 1);
961
- }
962
- /**
963
- * 属性,float类型,播放器音量,0-1.0,只影响当前播放器实例。
964
- */
965
- get volume() {
966
- return this.getState("volume");
967
- }
968
- set volume(value) {
969
- this.setState("volume", value, "number");
970
- }
971
- /**
972
- * 属性,double类型,起播时间,单位秒,可使用currentTime代替。
973
- */
974
- get startTime() {
975
- return this.getState("startTime");
976
- }
977
- set startTime(value) {
978
- this.setState("startTime", value, "number");
979
- }
980
- /**
981
- * 属性,double类型,可播放时长,本地缓存的视频时长,只支持读取。
982
- */
983
- get playableDuration() {
984
- return this.local.playableDuration;
985
- }
986
- /**
987
- * 属性,boolean类型,true表示关闭timeupdate事件上报。
988
- */
989
- set timeupdateless(value) {
990
- this.setState("timeUpdateLess", !!value, "boolean");
991
- }
992
- /**
993
- * 属性,boolean类型,true表示保留最后一帧,false表示不保留。
994
- */
995
- set keepLastFrame(value) {
996
- this.setState("keepLastFrame", !!value, "boolean");
997
- }
998
- /**
999
- * 设置播放地址。
1000
- * @param {string} url 播放地址。
1001
- * @param {String} windowMode 播放器窗口模式。
1002
- * null:使用this.windowMode作为窗口模式。
1003
- * full:观影模式,全屏方式,不建议修改w/h/l/t,视频清晰度/流畅度最佳;
1004
- * resizable:可变窗口模式,可以随意修改w/h/l/t,支持动画效果,视频清晰度/流畅度表现可能不如full模式;
1005
- * pip:画中画模式,只在支持多路硬解的情况下使用,用户画中画的小窗播放,对清晰度/流畅度要求较差,可能会有反交错问题。
1006
- * @param {string} head 网络请求的head信息,可以为NULL。
1007
- * @param {int} type 类型,1表示点播,2表示直播,3表示时移,4表示回看,默认1。
1008
- * @param {double} timeShift 时移时间,只有在type=3时才有效,表示从当前时间时移多长时间,单位秒。
1009
- * @param {int} 分辨率类型 0:unknown或其它;1:标清;2:高清;3:超清(720P);4:蓝光(1080P);5:2K;6:4K;7:8K。
1010
- * @param {int} 用户频道号,只在直播回看状态下需要设置
1011
- */
1012
- setSrc(url, windowMode, head, type, timeShift, resolution, mixNo) {
1013
- let src = {};
1014
- src.url = url;
1015
- if (head) {
1016
- src.head = head;
1017
- }
1018
- if (windowMode) {
1019
- src.windowMode = windowMode;
1020
- }
1021
- if (type) {
1022
- src.type = type;
1023
- } else {
1024
- src.type = 1;
1025
- }
1026
- if (type === 3 && timeShift) {
1027
- src.timeShift = timeShift;
1028
- }
1029
- if (resolution && typeof resolution === "number") {
1030
- src.resolution = resolution;
1031
- }
1032
- if (mixNo && typeof mixNo == "number") {
1033
- src.channelID = mixNo;
1034
- }
1035
- this.currentEventStatus = EVENT_STATUS_NONE;
1036
- this.setState("src", JSON.stringify(src), "string");
1037
- this.eventReport = true;
1038
- }
1039
- /**
1040
- * 添加监听事件。
1041
- * @param {string} type 事件类型。
1042
- * @param {callback} listener 事件处理函数。
1043
- */
1044
- addEventListener(type, listener) {
1045
- this["on" + type] = listener;
1046
- }
1047
- /**
1048
- * 重新加载视频流,初始化播放器。
1049
- */
1050
- load() {
1051
- this.setState("enablePlayer", true, "boolean");
1052
- }
1053
- /**
1054
- * 暂停
1055
- */
1056
- pause() {
1057
- this.local.paused = true;
1058
- this.setState("paused", true, "boolean");
1059
- if (this.hasOwnProperty("onpause")) {
1060
- this["onpause"]();
1061
- }
1062
- }
1063
- /**
1064
- * 播放
1065
- */
1066
- play() {
1067
- this.local.paused = false;
1068
- this.setState("paused", false, "boolean");
1069
- if (this.hasOwnProperty("onplay")) {
1070
- this["onplay"]();
1071
- }
1072
- }
1073
- /**
1074
- * 获取AudioTrack个数
1075
- * @returns total number of audio track.
1076
- */
1077
- getAudioTrackCount() {
1078
- let count = this.getProperty("audioTrackCount");
1079
- if (count === null) {
1080
- return 1;
1081
- }
1082
- return count;
1083
- }
1084
- /**
1085
- * 获取当前使用的audio track
1086
- * @returns the current playing track,-1 is invalid
1087
- */
1088
- getSelectedAudioTrack() {
1089
- return this.getState("audioTrack");
1090
- }
1091
- /**
1092
- * 选择audio track
1093
- * @param {*} track audio track index
1094
- */
1095
- selectAudioTrack(track) {
1096
- this.setState("audioTrack", track, "number");
1097
- }
1098
- /**
1099
- * 停止视频流。
1100
- */
1101
- unload() {
1102
- this.unloadPrivate();
1103
- this.currentEventStatus = EVENT_STATUS_NONE;
1104
- this.eventReport = true;
1105
- }
1106
- unloadPrivate() {
1107
- this.setState("paused", true, "boolean");
1108
- this.local.isRenderable = false;
1109
- this.setState("enablePlayer", false, "boolean");
1110
- this.changeFrameRate(false);
1111
- }
1112
- /**
1113
- * 要求终端访问指定的频道,并立即返回。对由本地设置为跳过的频道,也返回-1。
1114
- * 频道地址为通过 CTCSetConfig 设置的频道列表中的地址:
1115
- * 如频道地址为 igmp://的组播地址,则加入组播频道,播放器开始播放组播频道,并处理相应的时移等功能;
1116
- * 如频道地址为 rtsp://的单播地址,则连接单播频道,播放器开始播放;
1117
- * 如频道地址为 http://的地址,则浏览器直接发起请求,访问该页面。
1118
- * @param {int} mixNo 用户频道号。
1119
- * @returns {int} 0,表示成功;-1:表示频道号无效。
1120
- */
1121
- joinChannel(mixNo) {
1122
- logTrace("joinChannel, key=" + this.key + ", mixNo=" + mixNo);
1123
- if (this.type === "audio") {
1124
- logWarning$1("Audio player do not support joinChannel.");
1125
- return 0;
1126
- }
1127
- let ret = this.joinChannelPrivate(mixNo);
1128
- if (ret >= 0) {
1129
- this.currentEventStatus = EVENT_STATUS_NONE;
1130
- this.eventReport = true;
1131
- }
1132
- return ret;
1133
- }
1134
- joinChannelPrivate(mixNo) {
1135
- if (this.type === "audio") {
1136
- logWarning$1("Audio player do not support joinChannelPrivate.");
1137
- return 0;
1138
- }
1139
- if (mixNo <= 0) {
1140
- return -1;
1141
- }
1142
- let ret = 0;
1143
- if (this.playerCreate && this.appVisible) {
1144
- ret = window.jsvPlayerBridge.JoinChannel(this.key, mixNo);
1145
- }
1146
- if (ret >= 0) {
1147
- this.channelID = mixNo;
1148
- this.local.paused = false;
1149
- this.setState("paused", false, "boolean");
1150
- }
1151
- return ret;
1152
- }
1153
- /**
1154
- * 要求终端离开指定的频道,并立即返回。
1155
- * 如原频道地址为 igmp://的组播地址,则立即离开组播频道,播放器停止播放组播频道,并断开相应的时移连接;
1156
- * 如频道地址为 rtsp://的单播地址,则断开单播频道,播放器停止播放;
1157
- * 如频道地址为 http://的地址,则浏览器不作操作。
1158
- * 【注】:本方法只用于离开通过 joinChannel 方法加入的频道。
1159
- * @returns {int} 0,表示成功;-1:表示频道号无效。
1160
- */
1161
- leaveChannel() {
1162
- logTrace("leaveChannel, key=" + this.key + ", channelID=" + this.channelID);
1163
- if (this.type === "audio") {
1164
- logWarning$1("Audio player do not support leaveChannel.");
1165
- return 0;
1166
- }
1167
- let ret = this.leaveChannelPrivate();
1168
- this.currentEventStatus = EVENT_STATUS_NONE;
1169
- this.eventReport = true;
1170
- return ret;
1171
- }
1172
- leaveChannelPrivate() {
1173
- let ret = 0;
1174
- if (this.type === "audio") {
1175
- logWarning$1("Audio player do not support leaveChannelPrivate.");
1176
- return ret;
1177
- }
1178
- if (this.playerCreate && this.appVisible) {
1179
- ret = window.jsvPlayerBridge.leaveChannel(this.key);
1180
- }
1181
- this.channelID = -1;
1182
- return ret;
1183
- }
1184
- // /**
1185
- // * 快进。
1186
- // * @param {float} speed 2至32
1187
- // */
1188
- // fastForward(value) {
1189
- // this.setState("fastForward", value, "number");
1190
- // }
1191
- // /**
1192
- // * 快退。
1193
- // * @param {float} speed -2至-32
1194
- // */
1195
- // fastRewind(value) {
1196
- // this.setState("fastForward", value, "number");
1197
- // }
1198
- /**
1199
- * 当流停止后,不需要显示最后一帧,调用此接口清除。
1200
- */
1201
- clearLastFrame() {
1202
- logTrace("clearLastFrame, key=" + this.key);
1203
- if (typeof window.jsvPlayerBridge !== "undefined") {
1204
- window.jsvPlayerBridge.clearLastFrame(this.key);
1205
- }
1206
- return;
1207
- }
1208
- /**
1209
- * @return {int} 当前音量,0-100。
1210
- * */
1211
- getGlobalVolume() {
1212
- logTrace("getGlobalVolume, key=" + this.key);
1213
- if (typeof window.jsvPlayerBridge !== "undefined") {
1214
- return window.jsvPlayerBridge.getGlobalVolume(100);
1215
- }
1216
- return 0;
1217
- }
1218
- /**
1219
- * 设置系统音量。
1220
- * @param {int} volume 0-100,音量值。
1221
- * @param {int} flags 1表示显示音量调节UI;4表示使用提示音;5表示同时显示音量调节UI和使用提示音。
1222
- * */
1223
- setGlobalVolume(volume, flags) {
1224
- logTrace("setGlobalVolume, key=" + this.key + ", volume=" + volume + ", flags=" + flags);
1225
- if (typeof window.jsvPlayerBridge !== "undefined") {
1226
- return window.jsvPlayerBridge.setGlobalVolume(volume, typeof flags != "undefined" ? flags : 0, 100);
1227
- }
1228
- }
1229
- /**
1230
- * 调整系统音量,一次设置一个步长。
1231
- * @param {int} direction 1增大音量;-1减小音量。
1232
- * @param {int} flags FLAG_SHOW_UI(1)表示显示音量调节UI;FLAG_PLAY_SOUND(4)表示使用提示音。两个值可以是或的关系。
1233
- * */
1234
- adjustGlobalVolume(direction, flags) {
1235
- logTrace("adjustGlobalVolume, key=" + this.key + ", direction=" + direction + ", flags=" + flags);
1236
- if (typeof window.jsvPlayerBridge !== "undefined") {
1237
- return window.jsvPlayerBridge.adjustGlobalVolume(direction, typeof flags != "undefined" ? flags : 0);
1238
- }
1239
- }
1240
- /**
1241
- * 设置系统静音状态。
1242
- * @param {boolean} status true表示静音,false表示取消静音。
1243
- * @param {int} flags FLAG_SHOW_UI(1)表示显示音量调节UI;FLAG_PLAY_SOUND(4)表示使用提示音。两个值可以是或的关系。android 6.0(包含)以上有效。
1244
- * */
1245
- setGlobalMuted(status, flags) {
1246
- logTrace("setGlobalMuted, key=" + this.key + ", status=" + status + ", flags=" + flags);
1247
- if (typeof window.jsvPlayerBridge !== "undefined") {
1248
- logDebug("setMuted:" + status);
1249
- window.jsvPlayerBridge.setGlobalMuted(status, typeof flags != "undefined" ? flags : 0);
1250
- }
1251
- }
1252
- /**
1253
- * 获取系统静音状态。
1254
- * @return {boolean} true表示静音,false表示非静音。
1255
- * */
1256
- getGlobalMutedStatus() {
1257
- logTrace("getGlobalMutedStatus, key=" + this.key);
1258
- if (typeof window.jsvPlayerBridge !== "undefined") {
1259
- return window.jsvPlayerBridge.getGlobalMutedStatus();
1260
- }
1261
- }
1262
- /**
1263
- * 回到视频的开头。
1264
- */
1265
- gotoStart() {
1266
- logTrace("gotoStart, key=" + this.key);
1267
- if (this.playerCreate && this.appVisible) {
1268
- window.jsvPlayerBridge.gotoStart(this.key);
1269
- } else {
1270
- this.state["currentTime"] = 0;
1271
- }
1272
- }
1273
- /**
1274
- * 到达视频的末尾。
1275
- */
1276
- gotoEnd() {
1277
- logTrace("gotoEnd, key=" + this.key);
1278
- if (this.playerCreate && this.appVisible) {
1279
- window.jsvPlayerBridge.gotoEnd(this.key);
1280
- }
1281
- }
1282
- /**
1283
- * 获取timeShift状态,包含是否支持时移以及最大时移时间。
1284
- * @returns {JsonObject} 包含两个字段:1、timeShift,boolean类型,true表示支持时移;2、timeShiftLength,int类型,最大时移时长。
1285
- */
1286
- getTimeShiftInfo() {
1287
- logTrace("getTimeShiftInfo, key=" + this.key);
1288
- let result = this.getProperty("timeShift");
1289
- if (result != null && result != "")
1290
- return JSON.parse(result);
1291
- return null;
1292
- }
1293
- /**
1294
- * 设置时移时间。
1295
- * @param {double} time,值为从当前时间计算向前移动了多长时间,单位秒。
1296
- */
1297
- setTimeShift(time) {
1298
- logTrace("setTimeShift, key=" + this.key + ", time=" + time);
1299
- if (this.type === "audio") {
1300
- logWarning$1("Audio player do not support setTimeShift.");
1301
- return;
1302
- }
1303
- if (this.playerCreate && this.appVisible) {
1304
- window.jsvPlayerBridge.setTimeShift(this.key, time);
1305
- }
1306
- }
1307
- /**
1308
- * 设置色度抠像参数,只支持扣绿。
1309
- * 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
1310
- * @param {JSON object} chromaKey,抠像参数,JSON Object包含的参数如下:
1311
- * color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
1312
- * colorDistance,float类型,色域范围,范围0-1.0。
1313
- * edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
1314
- * greenOffset,float类型,红蓝差值,范围0-1.0。
1315
- */
1316
- setChromaKey(chromaKey) {
1317
- logTrace("setChromaKey, key=" + this.key + ", chroma key=" + JSON.stringify(chromaKey));
1318
- if (this.type === "audio") {
1319
- logWarning$1("Audio player do not support setChromaKey.");
1320
- return;
1321
- }
1322
- this.setState("chromaKey", JSON.stringify(chromaKey), "string");
1323
- }
1324
- setDebugMode(mode) {
1325
- logTrace("setDebugMode, key=" + this.key + ", mode=" + mode);
1326
- if (typeof window.jsvPlayerBridge !== "undefined") {
1327
- return window.jsvPlayerBridge.setDebugMode(this.key, mode);
1328
- }
1329
- }
1330
- /**
1331
- * 获取是否支持倍速设置,在onCanPlay事件发送以后,通过此接口查询。
1332
- * @returns {boolean} true:支持播放倍速设置;false:不支持播放倍速设置。
1333
- * */
1334
- supportPlaybackRateSet() {
1335
- logTrace("supportPlaybackRateSet, key=" + this.key);
1336
- if (typeof window.jsvPlayerBridge !== "undefined") {
1337
- return window.jsvPlayerBridge.supportRateSet(this.key);
1338
- }
1339
- return false;
1340
- }
1341
- /**
1342
- * 私有接口,外部不需要调用此接口。
1343
- */
1344
- setState(key, value, type) {
1345
- if (typeof value !== type) {
1346
- logWarning$1("invalid paramter type to set " + key + ". value is not " + type);
1347
- return;
1348
- }
1349
- this.state[key] = value;
1350
- logDebug("set " + key + " = " + value);
1351
- let param = {};
1352
- param[key] = value;
1353
- if (this.playerCreate && this.appVisible) {
1354
- window.jsvPlayerBridge.SetProperty(this.key, JSON.stringify(param));
1355
- }
1356
- }
1357
- /**
1358
- * 私有接口,外部不需要调用此接口。
1359
- */
1360
- getState(key) {
1361
- let value = this.state[key];
1362
- logDebug("get " + key + " = " + value);
1363
- if (typeof value == "undefined" && this.playerCreate && this.appVisible) {
1364
- value = window.jsvPlayerBridge.GetProperty(this.key, key);
1365
- this.state[key] = value;
1366
- }
1367
- return value;
1368
- }
1369
- /**
1370
- * 私有接口,外部不需要调用此接口。
1371
- */
1372
- getProperty(key) {
1373
- if (this.playerCreate && typeof window.jsvPlayerBridge != "undefined" && this.appVisible) {
1374
- let result_str = window.jsvPlayerBridge.GetProperty(this.key, key);
1375
- if (result_str == null || result_str == "")
1376
- return null;
1377
- let result = JSON.parse(result_str);
1378
- if (result.hasOwnProperty(key))
1379
- return result[key];
1380
- return null;
1381
- }
1382
- return null;
1383
- }
1384
- }
1385
- class JsvMedia extends JsvBaseMedia {
1386
- constructor(type, window_mode, hole_id, player_type, key, background, design_map_width, decode_type) {
1387
- super(type, window_mode, hole_id, player_type, key, background, design_map_width, decode_type);
1388
- }
1389
- }
1390
- class JsvMediaAudio extends JsvMedia {
1391
- constructor(key, design_map_width) {
1392
- super("audio", "resizable", 0, 3, key, true, design_map_width, 0);
1393
- }
1394
- }
1395
- class JsvMediaVideo extends JsvMedia {
1396
- constructor(hole_id, window_mode, player_type, key, background, design_map_width, decode_type) {
1397
- super("video", window_mode, hole_id, player_type, key, background, design_map_width, decode_type);
1398
- this.state.aspectRatio = "origin";
1399
- }
1400
- /**
1401
- * 属性,string类型,设置海报地址,未实现。
1402
- */
1403
- set poster(value) {
1404
- logWarning$1("Video.poster() TODO");
1405
- }
1406
- /**
1407
- * 属性,string类型,设置和读取显示模式。
1408
- * full(fill模式)表示拉升至充满显示区域;origin(contain模式)表示原始比例缩放至宽或高和显示区域相等(不超过显示区域);x:y表示按照指定比例显示。
1409
- */
1410
- get videoAspectRatio() {
1411
- return this.getState("aspectRatio");
1412
- }
1413
- set videoAspectRatio(value) {
1414
- this.setState("aspectRatio", value, "string");
1415
- }
1416
- /**
1417
- * 属性,int类型,只读,获取视频的宽。
1418
- */
1419
- get videoHeight() {
1420
- return this.getState("videoHeight");
1421
- }
1422
- /**
1423
- * 属性,int类型,只读,获取视频的宽。
1424
- */
1425
- get videoWidth() {
1426
- return this.getState("videoWidth");
1427
- }
1428
- }
1429
- function getJsvPlayerCapabilitySet() {
1430
- if (typeof window.jsvPlayerBridge !== "undefined") {
1431
- return window.jsvPlayerBridge.getCapabilitySet();
1432
- }
1433
- return null;
1434
- }
1435
- let handles = {
1436
- TextureManager: null,
1437
- RootView: null,
1438
- RootActivity: null
1439
- };
1440
- window.JsvCode.ForgeHandles.listenToReady(() => {
1441
- handles.TextureManager = window.JsvCode.ForgeHandles.TextureManager;
1442
- handles.RootView = window.JsvCode.ForgeHandles.RootView;
1443
- handles.RootActivity = window.JsvCode.ForgeHandles.RootActivity;
1444
- });
1445
- if (window.JsView)
1446
- ;
1447
- else {
1448
- const BrowserApic = await import("./BrowserApic.64639b51.js");
1449
- BrowserApic.default;
1450
- }
1451
- if (window.JsView)
1452
- ;
1453
- else {
1454
- const BrowserApic2 = await import("./BrowserApic2.8b0c8a0a.js");
1455
- BrowserApic2.default;
1456
- }
1457
- ({
1458
- TEXT: Forge$1.TextInputType.TEXT,
1459
- NUMBER: Forge$1.TextInputType.NUMBER,
1460
- PASSWORD: Forge$1.TextInputType.PASSWORD
1461
- });
1462
- const CONST_FORMAT_TOKEN = "_JsvP_";
1463
- const buildPreloadInfo$1 = (url, width = 0, height = 0, color_type = "RGBA_8888", net_setting = null, is_poster_img) => {
1464
- return {
1465
- url,
1466
- width,
1467
- height,
1468
- colorType: color_type,
1469
- netSetting: net_setting,
1470
- magicToken: CONST_FORMAT_TOKEN,
1471
- // 用于格式校验
1472
- isPosterImage: is_poster_img ?? false
1473
- };
1474
- };
1475
- if (window.JsView)
1476
- ;
1477
- else {
1478
- const BrowserPreload = await import("./BrowserPreload.fe21457d.js");
1479
- BrowserPreload.default;
1480
- }
1481
- let buildPreloadInfo = buildPreloadInfo$1;
1482
- class TextureInstantType {
1483
- static Auto = Forge$1.TextureInstantLoad.AUTO;
1484
- static Sync = Forge$1.TextureInstantLoad.SYNC;
1485
- static Async = Forge$1.TextureInstantLoad.ASYNC;
1486
- }
1487
- if (window.JsView)
1488
- ;
1489
- else {
1490
- const BrowserQrcode = await import("./BrowserQrcode.727b4b8f.js");
1491
- BrowserQrcode.default;
1492
- }
1493
- if (window.JsView)
1494
- ;
1495
- else {
1496
- const BrowserSpray = await import("./BrowserSpray.b126f2ae.js");
1497
- BrowserSpray.default;
1498
- }
1499
- /*!
1500
- * 【模块 export 内容】
1501
- * getKeyFramesGroup: 函数,获取KeyFrame操作类 KeyFrameStyleSheet
1502
- * KeyFrameStyleSheet:面向对象类,KeyFrames CSS rule的操作类,用于添加和删除KeyFrame
1503
- * 功能函数:(参数说明见函数本体)
1504
- * insertRule(key_frame_string) 动态添加keyFrame
1505
- * removeRule(name) 动态删除keyFrame
1506
- * removeMultiRules(names_array) 批量动态删除keyFrame
1507
- * hasRule(name) 查询KeyFrame是否存在
1508
- */
1509
- /*!
1510
- * getKeyFramesGroup 参数说明:
1511
- * anchor_tag (String) keyFrame的名称,可以不设置或者为undefined
1512
- * 返回值:
1513
- * KeyFrameStyleSheet 以anchor_tag为锚点,找到对应的cssRule,以此cssRule创建出的KeyFrame管理句柄
1514
- */
1515
- function getKeyFramesGroup(anchor_tag) {
1516
- return window.JsvCode.Dom.getKeyFrameGroup(anchor_tag);
1517
- }
1518
- getKeyFramesGroup(null);
1519
- const JsvSpriteAnim_vue_vue_type_style_index_0_scoped_c44130e9_lang = "";
1520
- const styleSheetsContent$1 = { "0": { "sprite-tag-c44130e9": "@keyframes sprite-tag-c44130e9 {}" } };
1521
- window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent$1);
1522
- if (window.JsView)
1523
- ;
1524
- else {
1525
- const BrowserTextureAnim = await import("./BrowserTextureAnim.e70349c2.js");
1526
- BrowserTextureAnim.default;
1527
- }
1528
- const _sfc_main$1 = {
1529
- props: {
1530
- style: {
1531
- type: Object,
1532
- default: () => {
1533
- return {};
1534
- }
1535
- },
1536
- getId: Function,
1537
- setId: String,
1538
- seeThrough: {
1539
- type: Boolean,
1540
- default: true
1541
- }
1542
- },
1543
- setup() {
1544
- return {
1545
- isBrowserDebug: window.jsvIsBrowserDebug,
1546
- jsvMainView: void 0,
1547
- innerViewId: void 0
1548
- };
1549
- },
1550
- beforeMount() {
1551
- if (this.isBrowserDebug) {
1552
- return;
1553
- }
1554
- let textureSetting = null;
1555
- if (this.seeThrough) {
1556
- const seeThroughTexture = handles.TextureManager.GetColorTexture("rgba(0,0,0,0)");
1557
- textureSetting = new Forge$1.TextureSetting(
1558
- seeThroughTexture,
1559
- null,
1560
- null,
1561
- false
1562
- );
1563
- }
1564
- this.jsvMainView = new Forge$1.NativeSharedView(textureSetting);
1565
- this.innerViewId = Forge$1.sViewStore.add(
1566
- new Forge$1.ViewInfo(this.jsvMainView)
1567
- );
1568
- if (typeof this.jsvMainView != "undefined" && this.jsvMainView) {
1569
- if (this.setId) {
1570
- this.jsvMainView.SetTrackId(this.setId);
1571
- }
1572
- this.getId?.(this.jsvMainView.GetTrackId());
1573
- }
1574
- },
1575
- beforeUnmount() {
1576
- if (this.isBrowserDebug) {
1577
- return;
1578
- }
1579
- if (this.innerViewId !== -1) {
1580
- Forge$1.sViewStore.remove(this.innerViewId);
1581
- this.innerViewId = -1;
1582
- this.jsvMainView = null;
1583
- }
1584
- }
1585
- };
1586
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
1587
- return !$setup.isBrowserDebug ? (openBlock(), createElementBlock("div", {
1588
- key: 0,
1589
- style: normalizeStyle({
1590
- left: $props.style.left,
1591
- top: $props.style.top,
1592
- width: $props.style.width,
1593
- height: $props.style.height
1594
- }),
1595
- "data-jsv-vw-innerview": $setup.innerViewId
1596
- }, [
1597
- renderSlot(_ctx.$slots, "default")
1598
- ], 12, ["data-jsv-vw-innerview"])) : (openBlock(), createElementBlock("div", {
1599
- key: 1,
1600
- style: normalizeStyle({ ...$props.style })
1601
- }, [
1602
- renderSlot(_ctx.$slots, "default")
1603
- ], 4));
1604
- }
1605
- const JsvNativeSharedDiv = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
1606
- //! 全局多实例互斥
1607
- if (typeof window.__JsvStyleClassMutex === "undefined") {
1608
- window.__JsvStyleClassMutex = 0;
1609
- }
1610
- window.__JsvStyleClassMutex++;
1611
- //! 用于存储用于Debug的全局引用
1612
- let DebugObjectRefer = {
1613
- RootRouter: null
1614
- };
1615
- let DebugTools = {
1616
- // 打印当前活跃的FDiv元素
1617
- printFocusNodes: () => {
1618
- DebugObjectRefer.RootRouter.printNodes();
1619
- }
1620
- };
1621
- //! 全局引用,以便于在devtools中能直接进行查询
1622
- window.JsvDebugTools = DebugTools;
1623
- /*!
1624
- * JsvPreDownloader 通用下载器,可以在不同的环境中进行资源下载操作。
1625
- * JsvPreDownloader.download:实例方法,根据传入参数来下载资源。支持单个url或者url列表,返回Promise对象。
1626
- * 参数:
1627
- * url {string | Array}: (必填)图片url
1628
- * netSetting {string}: 网络设置
1629
- * isImage {boolean} : 是否为图片
1630
- *
1631
- * JsvPreDownloader.buildDownloadItem: 实例方法,创建预下载信息项。
1632
- * 参数:
1633
- * url {string}: (必填)图片url
1634
- * netSetting {string}: 网络设置
1635
- * isImage {boolean} : 是否为图片
1636
- *
1637
- */
1638
- const TAG$1 = "JSvPreDownload";
1639
- let isNullNumber = 0;
1640
- let workNumber = 0;
1641
- class JsvPreDownloaderBase {
1642
- download(url, netSetting = "", isImage = false) {
1643
- return new Promise((resolve, reject) => {
1644
- if (typeof url === "string") {
1645
- this.downloadInner(url, netSetting, isImage).then(resolve, reject);
1646
- } else if (Array.isArray(url) && url.length > 0) {
1647
- const downloadResult = new Array(url.length);
1648
- const check = () => {
1649
- let allDone = false;
1650
- let allSuccess = true;
1651
- for (let i of downloadResult) {
1652
- if (!i?.succeed) {
1653
- allSuccess = false;
1654
- }
1655
- }
1656
- if (isNullNumber + workNumber == url.length) {
1657
- allDone = true;
1658
- }
1659
- if (allDone) {
1660
- if (allSuccess) {
1661
- resolve(downloadResult);
1662
- } else {
1663
- reject(downloadResult);
1664
- }
1665
- }
1666
- };
1667
- for (let i = 0; i < url.length; ++i) {
1668
- if (url[i] == null || url[i].url == null) {
1669
- downloadResult[i] = {
1670
- succeed: false,
1671
- info: {
1672
- errorCode: 100,
1673
- errorInfo: "This item is null or url is null",
1674
- url: null
1675
- }
1676
- };
1677
- isNullNumber += 1;
1678
- } else {
1679
- this.downloadInner(url[i].url, url[i].netSetting, !!url[i].isImage).then(
1680
- (info) => {
1681
- downloadResult[i] = {
1682
- succeed: true,
1683
- info
1684
- };
1685
- workNumber += 1;
1686
- check();
1687
- },
1688
- (errorInfo) => {
1689
- downloadResult[i] = {
1690
- succeed: false,
1691
- info: errorInfo
1692
- };
1693
- workNumber += 1;
1694
- check();
1695
- }
1696
- );
1697
- }
1698
- }
1699
- } else {
1700
- console.error(TAG$1, "download url invalid", url);
1701
- reject("download url invalid.");
1702
- }
1703
- });
1704
- }
1705
- buildDownloadItem(url, netSetting = "", isImage = false) {
1706
- const item = {
1707
- url,
1708
- netSetting,
1709
- isImage
1710
- };
1711
- return item;
1712
- }
1713
- }
1714
- class JsvPreDownloaderInJsView extends JsvPreDownloaderBase {
1715
- downloadInner(url, netSetting = "", isImage = false) {
1716
- return new Promise((resolve, reject) => {
1717
- if (typeof window.jJsvInnerUtils !== "undefined" && typeof window.jJsvInnerUtils.downloadResource) {
1718
- const setting = {
1719
- netSetting,
1720
- fileType: isImage ? "image" : "notImage"
1721
- };
1722
- window.jJsvInnerUtils.downloadResource(url, JSON.stringify(setting), (info) => {
1723
- try {
1724
- const obj = JSON.parse(info);
1725
- const result = JSON.parse(obj.info);
1726
- if (obj.status == 0) {
1727
- resolve(result);
1728
- } else {
1729
- console.warn("JsvPreDownload: download failed", result);
1730
- reject(result);
1731
- }
1732
- } catch (e) {
1733
- reject("JsvPreDownload: parse callback info failed: " + info);
1734
- }
1735
- });
1736
- } else {
1737
- console.error("JsvPreDownload: window.jJsvInnerUtils.downloadResource not exist.");
1738
- reject("window.jJsvInnerUtils.downloadResource not exist.");
1739
- }
1740
- });
1741
- }
1742
- }
1743
- class JsvPreDownloaderInBrowser extends JsvPreDownloaderBase {
1744
- downloadInner(url, netSetting = "", isImage = false) {
1745
- return new Promise((resolve, reject) => {
1746
- if (isImage) {
1747
- const image = new Image();
1748
- image.onload = () => {
1749
- console.log("load image");
1750
- resolve({
1751
- url,
1752
- path: "",
1753
- fileType: "image",
1754
- imageSize: {
1755
- width: image.width,
1756
- height: image.height
1757
- }
1758
- });
1759
- };
1760
- image.onerror = () => {
1761
- console.error(TAG$1, "browser load image failed.");
1762
- reject({
1763
- url,
1764
- errorCode: -1,
1765
- errorInfo: "browser load image failed"
1766
- });
1767
- };
1768
- image.src = url;
1769
- } else {
1770
- resolve({
1771
- url,
1772
- path: "",
1773
- fileType: "notImage"
1774
- });
1775
- }
1776
- });
1777
- }
1778
- }
1779
- const exportObj = window.JsView ? JsvPreDownloaderInJsView : JsvPreDownloaderInBrowser;
1780
- window.Test = exportObj;
1781
- ({
1782
- CIRCLE: Forge.FilterView.WAVE.CIRCLE_WAVE,
1783
- RECTANGLE: Forge.FilterView.WAVE.RECTANGLE_WAVE
1784
- });
1785
- const JsvLine_vue_vue_type_style_index_0_scoped_0eaf20d3_lang = "";
1786
- const styleSheetsContent = { "0": { "fadeIn-0eaf20d3": "@keyframes fadeIn-0eaf20d3 {0%{opacity:0;}100%{opacity:1;}}", "fadeOut-0eaf20d3": "@keyframes fadeOut-0eaf20d3 {0%{opacity:1;}100%{opacity:0;}}" } };
1787
- window.JsvCode.Dom.DeclareStyleSheets(styleSheetsContent);
1788
- const _sfc_main = {
1789
- props: {
1790
- /**
1791
- * 回调函数,播放器对象通知接口
1792
- * @param {Object} video对象,可以通过此video对象调用video相关属性和方法,具体属性和方法定义见JsvMedia.js文件里相关说明。
1793
- */
1794
- onRef: { type: Function, default: () => {
1795
- } },
1796
- /**
1797
- * 属性,Boolean类型,true表示自动播放,默认false。
1798
- */
1799
- autoplay: { type: Boolean, default: false },
1800
- /**
1801
- * 属性,String类型,播放器实例索引,同样的key使用同一个播放器实例。
1802
- */
1803
- playerKey: { type: String, default: null },
1804
- /**
1805
- * 属性,String类型,播放器窗口模式,默认resizable模式。
1806
- * full:观影模式,全屏方式,不建议修改w/h/l/t,视频清晰度/流畅度最佳;
1807
- * resizable:可变窗口模式,可以随意修改w/h/l/t,支持动画效果,视频清晰度/流畅度表现可能不如full模式;
1808
- * pip:画中画模式,只在支持多路硬解的情况下使用,用户画中画的小窗播放,对清晰度/流畅度要求较差,可能会有反交错问题。
1809
- */
1810
- windowMode: { type: String, default: "resizable" },
1811
- /**
1812
- * 属性,int类型,底层使用的播放器类型。1:系统播放器;2:jsv视频播放器;3:jsv音频播放器。默认2。
1813
- */
1814
- playerType: { type: Number, default: 2 },
1815
- /**
1816
- * 属性,int类型,播放器解码方式。0:根据硬件能力自动匹配;1:硬解码;2:软解码。默认0(根据芯片能力自动匹配)。
1817
- */
1818
- decodeType: { type: Number, default: 0 },
1819
- /**
1820
- * 属性,Boolean类型,层级关系,true表示在界面的下面,false表示在界面上面,默认true。
1821
- */
1822
- background: { type: Boolean, default: true },
1823
- /**
1824
- * 属性,Boolean类型,true表示静音,默认false。
1825
- */
1826
- muted: { type: Boolean, default: false },
1827
- /**
1828
- * 属性,Boolean类型,true表示循环播放,默认false。
1829
- */
1830
- loop: { type: Boolean, default: false },
1831
- /**
1832
- * 属性,String类型,播放地址。
1833
- */
1834
- src: { type: String, default: "" },
1835
- /**
1836
- * 属性,Double类型,起播时间,0-duration。
1837
- */
1838
- currentTime: { type: Number, default: 0 },
1839
- /**
1840
- * 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
1841
- */
1842
- keepLastFrame: { type: Boolean, default: true },
1843
- /**
1844
- * 属性,String类型,视频显示比例,origin原始比例显示,full全屏显示,x:y按照指定比例显示。
1845
- */
1846
- videoAspectRatio: { type: String, default: "origin" },
1847
- /**
1848
- * 属性,JSON Object类型,色度抠像参数,包含color,colorDistance,edgeDistance,greenOffset四个参数,
1849
- * 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
1850
- * color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
1851
- * colorDistance,float类型,色域范围,范围0-1.0。
1852
- * edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
1853
- * greenOffset,float类型,红蓝差值,范围0-1.0。
1854
- * 目前只支持扣绿。
1855
- */
1856
- chromaKey: { type: Object, default: null },
1857
- /**
1858
- * 回调函数,播放结束时通过此回调接口通知。
1859
- */
1860
- onEnded: { type: Function, default: () => {
1861
- return {};
1862
- } },
1863
- /**
1864
- * 回调函数,播放错误时通过此接口通知。
1865
- * @param {int} 错误类型,当前定义了四种错误。1是异常中断;2是网络错误;3是解码错误;4是格式不支持。
1866
- */
1867
- onError: { type: Function, default: () => {
1868
- return {};
1869
- } },
1870
- // onAbort: {type: Function, default: ()=>{return{}}},
1871
- /**
1872
- * 回调函数,当正常播放时,每0.5秒上报一次,回调接口里会带上当前时间,也可以使用video对象的currentTime属性去获取当前时间。
1873
- * @param {Long} 当前播放时间,单位秒。
1874
- */
1875
- onTimeUpdate: { type: Function, default: () => {
1876
- return {};
1877
- } },
1878
- /**
1879
- * 回调函数,开始加载,设置完播放地址后,上报此事件。
1880
- */
1881
- onLoadStart: { type: Function, default: () => {
1882
- return {};
1883
- } },
1884
- /**
1885
- * 回调函数,开始正常播放,同一个播放地址仅触发一次。
1886
- */
1887
- onCanPlayThrough: { type: Function, default: () => {
1888
- return {};
1889
- } },
1890
- /**
1891
- * 回调函数,正常下载,duration不变的情况下只触发一次。
1892
- */
1893
- onProgress: { type: Function, default: () => {
1894
- return {};
1895
- } },
1896
- /**
1897
- * 回调函数,视频准备好后触发。
1898
- */
1899
- onLoadedMetaData: { type: Function, default: () => {
1900
- return {};
1901
- } },
1902
- /**
1903
- * 回调函数,视频准备好后触发,这个时候可以正常seek。
1904
- */
1905
- onLoad: { type: Function, default: () => {
1906
- return {};
1907
- } },
1908
- /**
1909
- * 回调函数,视频准备好后触发,这个时候可以获取duration。
1910
- */
1911
- onDurationChange: { type: Function, default: () => {
1912
- return {};
1913
- } },
1914
- /**
1915
- * 回调函数,视频准备好后,seek(修改currentTime)会出发此事件。
1916
- */
1917
- onSeeking: { type: Function, default: () => {
1918
- return {};
1919
- } },
1920
- /**
1921
- * 回调函数,seek完成后触发此事件。
1922
- */
1923
- onSeeked: { type: Function, default: () => {
1924
- return {};
1925
- } },
1926
- /**
1927
- * 回调函数,缓冲时触发。
1928
- */
1929
- onStalled: { type: Function, default: () => {
1930
- return {};
1931
- } },
1932
- /**
1933
- * 回调函数,正常播放后触发。
1934
- */
1935
- onPlaying: { type: Function, default: () => {
1936
- return {};
1937
- } },
1938
- /**
1939
- * 回调函数,正常显示后触发此事件。
1940
- */
1941
- onCanPlay: { type: Function, default: () => {
1942
- return {};
1943
- } },
1944
- /**
1945
- * 回调函数,音频失去焦点后触发此事件,可能会导致pause(点播)或者离开频道(直播)。
1946
- */
1947
- onAudioFocusLoss: { type: Function, default: () => {
1948
- return {};
1949
- } },
1950
- /**
1951
- * 回调函数,音频获取焦点后触发此事件,可能会触发resume(点播)或者加入频道(直播)。
1952
- */
1953
- onAudioFocusGain: { type: Function, default: () => {
1954
- return {};
1955
- } },
1956
- /**
1957
- * 回调函数,直播进入时移状态时,触发此事件。
1958
- */
1959
- onTimeShift: { type: Function, default: () => {
1960
- return {};
1961
- } },
1962
- /**
1963
- * 回调函数,直播进入时移状态时,成功播放触发此事件。
1964
- */
1965
- onTimeShifted: { type: Function, default: () => {
1966
- return {};
1967
- } },
1968
- /**
1969
- * 回调函数,时移回到直播状态,触发此事件。
1970
- */
1971
- onBackLive: { type: Function, default: () => {
1972
- return {};
1973
- } },
1974
- /**
1975
- * 回调函数,时移回到直播状态时,成功播放触发此事件。
1976
- */
1977
- onBackLived: { type: Function, default: () => {
1978
- return {};
1979
- } },
1980
- /**
1981
- * 属性,Object类型,设置窗口属性,同其他组件的style设置。
1982
- */
1983
- style: { type: Object, default: () => {
1984
- return {};
1985
- } },
1986
- /**
1987
- * 属性,Boolean类型,活跃状态,当多个JsvPlayer组件指向一个video对象时,只能有一个处于活跃状态。
1988
- * 视频显示在活跃JsvPlayer设置的显示区域内,事件通知也只会送给活跃的JsvPlayer组件注册的回调函数。
1989
- */
1990
- active: { type: Boolean, default: true }
1991
- },
1992
- components: {
1993
- JsvNativeSharedDiv
1994
- },
1995
- watch: {
1996
- active(newValue) {
1997
- logDebug("active newValue: " + newValue);
1998
- if (this.video && this.playerType !== 3) {
1999
- if (newValue) {
2000
- this.registerEvent();
2001
- this.video.setHoleID(this.holeId);
2002
- this.holeStyle = {
2003
- left: 0,
2004
- top: 0,
2005
- width: this.style.width,
2006
- height: this.style.height
2007
- };
2008
- } else {
2009
- this.holeStyle = {
2010
- left: 0,
2011
- top: 0,
2012
- width: 0,
2013
- height: 0
2014
- };
2015
- }
2016
- }
2017
- },
2018
- style(newValue) {
2019
- logDebug("holeStyle newValue: left=" + newValue.left + ", top=" + newValue.top + ", width=" + newValue.width + ", height=" + newValue.height);
2020
- if (this.active && this.playerType !== 3) {
2021
- this.holeStyle = {
2022
- left: 0,
2023
- top: 0,
2024
- width: newValue.width,
2025
- height: newValue.height
2026
- };
2027
- }
2028
- },
2029
- keepLastFrame(newValue) {
2030
- logDebug("keepLastFrame newValue: " + newValue);
2031
- if (this.video && this.active) {
2032
- this.video.keepLastFrame = this.keepLastFrame;
2033
- }
2034
- }
2035
- },
2036
- setup() {
2037
- return {
2038
- video: null,
2039
- holeId: ""
2040
- };
2041
- },
2042
- data() {
2043
- return {
2044
- holeStyle: {}
2045
- };
2046
- },
2047
- created() {
2048
- },
2049
- mounted() {
2050
- logDebug("JsvPlayer:", this.style);
2051
- let key = "Jsv_" + Math.floor(Math.random() * 1e4);
2052
- if (this.playerKey) {
2053
- key = this.playerKey;
2054
- }
2055
- logDebug("player key:" + key);
2056
- let player_type = 2;
2057
- if (this.playerType)
2058
- player_type = this.playerType;
2059
- let background = true;
2060
- if (!this.background)
2061
- background = this.background;
2062
- logDebug("JsvPlayer background:" + background);
2063
- const designMap = window.Forge.DesignMap();
2064
- logDebug("JsvPlayer:", this.holeId);
2065
- this.video = findMediaObjectByKey(key);
2066
- let first_create = true;
2067
- if (!this.video) {
2068
- if (player_type === 3) {
2069
- this.video = new JsvMediaAudio(key, designMap.width);
2070
- } else {
2071
- this.video = new JsvMediaVideo(this.holeId, this.windowMode, player_type, key, background, designMap.width, this.decodeType);
2072
- }
2073
- } else {
2074
- this.video.setRef();
2075
- first_create = false;
2076
- }
2077
- if (this.video != null) {
2078
- if (this.active) {
2079
- this.registerEvent();
2080
- if (this.src && this.src !== "")
2081
- this.video.src = this.src;
2082
- if (this.currentTime !== 0)
2083
- this.video.currentTime = this.currentTime;
2084
- if (this.autoplay) {
2085
- this.video.autoplay = this.autoplay;
2086
- }
2087
- if (this.muted) {
2088
- this.video.muted = this.muted;
2089
- }
2090
- if (this.loop) {
2091
- this.video.loop = this.loop;
2092
- }
2093
- if (!this.keepLastFrame) {
2094
- this.video.keepLastFrame = this.keepLastFrame;
2095
- }
2096
- if (this.videoAspectRatio !== "origin") {
2097
- this.video.videoAspectRatio = this.videoAspectRatio;
2098
- }
2099
- if (this.chromaKey && this.chromaKey !== "") {
2100
- this.video.setChromaKey(this.chromaKey);
2101
- }
2102
- if (!first_create) {
2103
- this.video.setHoleID(this.holeId);
2104
- if (this.playerType !== 3) {
2105
- this.holeStyle = {
2106
- left: 0,
2107
- top: 0,
2108
- width: this.style.width,
2109
- height: this.style.height
2110
- };
2111
- }
2112
- }
2113
- }
2114
- this.onRef?.(this.video);
2115
- }
2116
- },
2117
- unmounted() {
2118
- if (this.video != null) {
2119
- this.video.releasePlayer();
2120
- this.onRef?.(null);
2121
- }
2122
- },
2123
- methods: {
2124
- getHoleId(id) {
2125
- logDebug("getHoleId:");
2126
- this.holeId = id;
2127
- },
2128
- registerEvent() {
2129
- if (this.video && this.active) {
2130
- this.video.addEventListener("end", this.onEnded);
2131
- this.video.addEventListener("error", this.onError);
2132
- this.video.addEventListener("timeupdate", this.onTimeUpdate);
2133
- this.video.addEventListener("loadstart", () => {
2134
- logDebug("JsvPlayer received loadstart event.");
2135
- if (this.playerType !== 3) {
2136
- this.holeStyle = {
2137
- left: 0,
2138
- top: 0,
2139
- width: this.style.width,
2140
- height: this.style.height
2141
- };
2142
- }
2143
- this.onLoadStart();
2144
- });
2145
- this.video.addEventListener("canplaythrough", this.onCanPlayThrough);
2146
- this.video.addEventListener("progress", this.onProgress);
2147
- this.video.addEventListener("loadedmetadata", this.onLoadedMetaData);
2148
- this.video.addEventListener("load", this.onLoad);
2149
- this.video.addEventListener("durationchange", this.onDurationChange);
2150
- this.video.addEventListener("seeking", this.onSeeking);
2151
- this.video.addEventListener("seeked", this.onSeeked);
2152
- this.video.addEventListener("stalled", this.onStalled);
2153
- this.video.addEventListener("playing", this.onPlaying);
2154
- this.video.addEventListener("canplay", this.onCanPlay);
2155
- this.video.addEventListener("audiofocusloss", this.onAudioFocusLoss);
2156
- this.video.addEventListener("audiofocusgain", this.onAudioFocusGain);
2157
- this.video.addEventListener("timeshift", this.onTimeShift);
2158
- this.video.addEventListener("timeshifted", this.onTimeShifted);
2159
- this.video.addEventListener("backlive", this.onBackLive);
2160
- this.video.addEventListener("backlived", this.onBackLived);
2161
- }
2162
- }
2163
- }
2164
- };
2165
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2166
- const _component_JsvNativeSharedDiv = resolveComponent("JsvNativeSharedDiv");
2167
- return $props.playerType != 3 ? (openBlock(), createElementBlock("div", {
2168
- key: 0,
2169
- style: normalizeStyle($props.style),
2170
- backgroundColor: "rgba(0,0,0,1)"
2171
- }, [
2172
- createVNode(_component_JsvNativeSharedDiv, {
2173
- style: normalizeStyle($data.holeStyle),
2174
- getId: $options.getHoleId
2175
- }, null, 8, ["style", "getId"])
2176
- ], 4)) : createCommentVNode("", true);
2177
- }
2178
- const JsvPlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
2179
- //! 考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
2180
- let _JsvPlayer = JsvPlayer;
2181
- if (window.jsvIsBrowserDebug) {
2182
- const BrowserPlayer = await import("./BrowserJsvPlayer.a6858caf.js");
2183
- _JsvPlayer = BrowserPlayer.default;
2184
- }
2185
- let PluginInfo$1 = {
2186
- // downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
2187
- packageName: "com.qcode.jsvaudio",
2188
- name: "音频插件",
2189
- version: "1.0.27",
2190
- //插件需要的版本号
2191
- versionCodeMin: 27,
2192
- versionCodeMax: 27,
2193
- bridgeName: "jsvAudioBridge",
2194
- //插件bridge注册到jsview的名称
2195
- className: "com.qcode.jsvaudio.JsvAudio",
2196
- //插件初始化类名称
2197
- initMethod: "createInstance",
2198
- //插件初始化方法
2199
- listener: "top.JsvAudioPluginLoadResult",
2200
- //插件加载结果回调
2201
- listener2: "top.JsvAudioPluginStatus"
2202
- // debug:true,
2203
- // md5:"baafc8ea737adcad5443f44cc0112498"
2204
- };
2205
- let PluginLoader$1 = class PluginLoader {
2206
- constructor() {
2207
- this.onDoneListener = [];
2208
- this.pluginLoadListener = [];
2209
- this.pluginInfo = this.getPluginInfo();
2210
- this.status = 0;
2211
- }
2212
- getPluginInfo() {
2213
- let info = PluginInfo$1;
2214
- if (typeof window.jJsvRuntimeBridge !== "undefined" && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
2215
- let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
2216
- if (plugin_base_url) {
2217
- info.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : plugin_base_url + "/") + info.packageName + "/JsvAudio-" + info.versionCodeMax + ".dat?md5=" + info.md5;
2218
- }
2219
- }
2220
- return info;
2221
- }
2222
- registerOnDoneListener(listener) {
2223
- if (listener) {
2224
- this.onDoneListener.push(listener);
2225
- }
2226
- }
2227
- /**
2228
- * listener回调处理中参数信息的说明:
2229
- * 插件加载状态回调。
2230
- * 回调函数的参数定义如下:
2231
- * 1:无法正常加载插件。
2232
- * 2:正在加载旧插件,此时插件加载过程很短,可以不用出现用户提示界面。
2233
- * 3:正在加载新插件,此时插件需要经历下载、解压等过程,用时较长,可以考虑给用户相关提示。
2234
- * 4:插件加载完成。
2235
- * 5:已加载不同版本的插件,此版本无法加载。
2236
- *
2237
- * 备注:不管插件加载处于什么状态,都可以正常使用播放器组件,播放器对象在插件未加载完成的情况下,会把相关状态保存,等完成加载后再自动下发。
2238
- */
2239
- loadPlugin(listener) {
2240
- console.log("globalLoadJsvAudioPlugin");
2241
- let plugin_status = 0;
2242
- if (typeof window.jPluginManagerBridge === "undefined" || !window.jPluginManagerBridge) {
2243
- plugin_status = 1;
2244
- } else if (this.status === 2) {
2245
- plugin_status = 2;
2246
- } else if (this.status === 3) {
2247
- plugin_status = 3;
2248
- } else if (this.status === 4) {
2249
- plugin_status = 4;
2250
- } else if (this.status === 5) {
2251
- plugin_status = 1;
2252
- }
2253
- if (plugin_status !== 0) {
2254
- if (typeof listener !== "undefined" && listener) {
2255
- setTimeout(() => {
2256
- listener(plugin_status);
2257
- }, 0);
2258
- }
2259
- return;
2260
- }
2261
- if (typeof listener !== "undefined" && listener) {
2262
- this.pluginLoadListener.push(listener);
2263
- }
2264
- if (this.status > 0) {
2265
- return;
2266
- }
2267
- this.status = 1;
2268
- window.jPluginManagerBridge.LoadPlugin(JSON.stringify(this.pluginInfo));
2269
- }
2270
- onStatusChange(status) {
2271
- console.log("JsvAudioPluginStatus: " + status);
2272
- let ret = JSON.parse(status);
2273
- let plugin_status = 2;
2274
- if (ret && ret.first_load) {
2275
- this.status = 3;
2276
- plugin_status = 3;
2277
- } else {
2278
- this.status = 2;
2279
- }
2280
- for (let i = 0; i < this.pluginLoadListener.length; i++) {
2281
- this.pluginLoadListener[i](plugin_status);
2282
- }
2283
- }
2284
- onLoadDone(result) {
2285
- console.log("JsvAudioPluginLoadResult: " + result);
2286
- let ret_obj = JSON.parse(result);
2287
- let plugin_status = 1;
2288
- if (ret_obj && (ret_obj.status === 4 || ret_obj.status === 1)) {
2289
- this.status = 4;
2290
- plugin_status = 4;
2291
- } else if (ret_obj && ret_obj.status === -12) {
2292
- this.status = 5;
2293
- plugin_status = 5;
2294
- } else {
2295
- this.status = 5;
2296
- }
2297
- if (this.status === 5) {
2298
- console.log("*************************JsvAudio plugin load failed, error code is " + ret_obj.status + "*************************");
2299
- }
2300
- for (let i = 0; i < this.pluginLoadListener.length; i++) {
2301
- this.pluginLoadListener[i](plugin_status);
2302
- }
2303
- for (let listener of this.onDoneListener) {
2304
- listener(plugin_status);
2305
- }
2306
- }
2307
- registerGlobalListener() {
2308
- window.top.JsvAudioPluginStatus = this.onStatusChange.bind(this);
2309
- window.top.JsvAudioPluginLoadResult = this.onLoadDone.bind(this);
2310
- }
2311
- };
2312
- const sPluginLoader$1 = new PluginLoader$1();
2313
- sPluginLoader$1.registerGlobalListener();
2314
- class JsvAudioBridgeProxy {
2315
- static isReady() {
2316
- return typeof window.jsvAudioBridge != "undefined" && !!window.jsvAudioBridge;
2317
- }
2318
- static CreateAudio(key) {
2319
- if (typeof window.jsvAudioBridge != "undefined" && typeof window.jsvAudioBridge.CreateAudio != "undefined") {
2320
- return window.jsvAudioBridge.CreateAudio(key);
2321
- }
2322
- return Promise.reject(JSON.stringify({
2323
- state: -2,
2324
- errorInfo: "jsvAudioBridge is null."
2325
- }));
2326
- }
2327
- static ReleasePlayer(key) {
2328
- if (typeof window.jsvAudioBridge != "undefined" && typeof window.jsvAudioBridge.ReleasePlayer != "undefined") {
2329
- return window.jsvAudioBridge.ReleasePlayer(key);
2330
- }
2331
- return -1;
2332
- }
2333
- static GetProperty(key, name) {
2334
- if (typeof window.jsvAudioBridge != "undefined" && typeof window.jsvAudioBridge.GetProperty != "undefined") {
2335
- return window.jsvAudioBridge.GetProperty(key, name);
2336
- }
2337
- return null;
2338
- }
2339
- static SetProperty(key, params) {
2340
- if (typeof window.jsvAudioBridge != "undefined" && typeof window.jsvAudioBridge.SetProperty != "undefined") {
2341
- return window.jsvAudioBridge.SetProperty(key, params);
2342
- }
2343
- }
2344
- static ScreenWakeLock(lock) {
2345
- if (typeof window.jsvAudioBridge != "undefined" && typeof window.jsvAudioBridge.ScreenWakeLock != "undefined") {
2346
- window.jsvAudioBridge.ScreenWakeLock(lock);
2347
- }
2348
- }
2349
- }
2350
- const isArray = Array.isArray;
2351
- const isObject = (val) => val !== null && typeof val === "object";
2352
- function getType(ctor) {
2353
- const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
2354
- return match ? match[1] : ctor === null ? "null" : "";
2355
- }
2356
- const objectToString = Object.prototype.toString;
2357
- const toTypeString = (value) => objectToString.call(value);
2358
- const toRawType = (value) => {
2359
- return toTypeString(value).slice(8, -1);
2360
- };
2361
- function makeMap(str, expectsLowerCase) {
2362
- const map = /* @__PURE__ */ Object.create(null);
2363
- const list = str.split(",");
2364
- for (let i = 0; i < list.length; i++) {
2365
- map[list[i]] = true;
2366
- }
2367
- return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];
2368
- }
2369
- const isSimpleType = /* @__PURE__ */ makeMap("String,Number,Boolean,Function,Symbol,BigInt");
2370
- function checkType(value, type) {
2371
- if (typeof type === "undefined" || type === null) {
2372
- return true;
2373
- }
2374
- let valid;
2375
- const expectedType = getType(type);
2376
- if (isSimpleType(expectedType)) {
2377
- const t = typeof value;
2378
- valid = t === expectedType.toLowerCase();
2379
- if (!valid && t === "object") {
2380
- valid = value instanceof type;
2381
- }
2382
- } else if (expectedType === "Object") {
2383
- valid = isObject(value);
2384
- } else if (expectedType === "Array") {
2385
- valid = isArray(value);
2386
- } else if (expectedType === "null") {
2387
- valid = value === null;
2388
- } else {
2389
- valid = value instanceof type;
2390
- }
2391
- return valid;
2392
- }
2393
- const Events = {
2394
- EVENT_EXT: "onEventExt",
2395
- // QCode Modify
2396
- EVENT_LOAD_START: "onLoadStart",
2397
- EVENT_LOAD: "onLoad",
2398
- EVENT_ERROR: "onError",
2399
- EVENT_PROGRESS: "onProgress",
2400
- EVENT_END: "onEnd",
2401
- EVENT_PAUSE: "onPause",
2402
- EVENT_PLAY: "onPlay",
2403
- EVENT_AUDIO_FOCUS_GAIN: "onAudioFocusGain",
2404
- EVENT_AUDIO_FOCUS_LOSS: "onAudioFocusLoss"
2405
- };
2406
- class ScreenLockManager {
2407
- static refCount = 0;
2408
- static lock() {
2409
- ScreenLockManager.refCount++;
2410
- JsvAudioBridgeProxy.ScreenWakeLock(true);
2411
- }
2412
- static unlock() {
2413
- ScreenLockManager.refCount = Math.max(0, ScreenLockManager.refCount - 1);
2414
- if (ScreenLockManager.refCount == 0) {
2415
- JsvAudioBridgeProxy.ScreenWakeLock(false);
2416
- }
2417
- }
2418
- }
2419
- const TAG = "JsvAudio";
2420
- class AudioManager {
2421
- constructor() {
2422
- this.audioMap = {};
2423
- sPluginLoader$1.registerOnDoneListener(this.onPluginLoadDone.bind(this));
2424
- }
2425
- createAudio(id) {
2426
- if (!Object.hasOwn(this.audioMap, id)) {
2427
- this.audioMap[id] = new AudioProxy(id, this);
2428
- } else {
2429
- this.audioMap[id].ref();
2430
- }
2431
- if (!JsvAudioBridgeProxy.isReady()) {
2432
- sPluginLoader$1.loadPlugin();
2433
- } else {
2434
- this.audioMap[id].buildPlatformInstance();
2435
- }
2436
- return this.audioMap[id];
2437
- }
2438
- releaseAudio(id) {
2439
- delete this.audioMap[id];
2440
- }
2441
- onPluginLoadDone(status) {
2442
- for (let id in this.audioMap) {
2443
- this.audioMap[id].buildPlatformInstance();
2444
- }
2445
- }
2446
- }
2447
- new AudioManager();
2448
- const AUDIO_PROPS = {
2449
- "src": { type: Object },
2450
- "paused": { type: Boolean },
2451
- "autoplay": { type: Boolean },
2452
- "volume": { type: Number },
2453
- "muted": { type: Boolean },
2454
- "loop": { type: Boolean },
2455
- "enablePlayer": { type: Boolean }
2456
- };
2457
- class AudioProxy {
2458
- constructor(id, audioManager) {
2459
- this._onEvent = this.onEvent.bind(this);
2460
- this._playerId = id;
2461
- this._ref = 1;
2462
- this._audioManager = audioManager;
2463
- this._created = false;
2464
- this._eventListener = {};
2465
- this._propCache = {};
2466
- this._onVisibilityChange = this.onVisibilityChange.bind(this);
2467
- window.JsView?.onVisibilityChange(this._onVisibilityChange);
2468
- }
2469
- /** 初始化函数, 外部不应该调用 */
2470
- buildPlatformInstance() {
2471
- console.log("buildPlatformInstance, key=" + this._playerId);
2472
- if (!JsvAudioBridgeProxy.isReady()) {
2473
- console.error("no jsvAudioBridge");
2474
- return;
2475
- }
2476
- JsvAudioBridgeProxy.CreateAudio(this._playerId).then((data) => {
2477
- const info = JSON.parse(data);
2478
- if (info.state == 0) {
2479
- this.initPlayer();
2480
- } else {
2481
- console.error(TAG, "create audio failed", info.errorInfo);
2482
- }
2483
- });
2484
- }
2485
- initPlayer() {
2486
- if (this._created)
2487
- return;
2488
- console.log("InitPlayer:1, key=" + this._playerId);
2489
- this._created = true;
2490
- window.JMD.subscribe(this._playerId, this._onEvent);
2491
- this.initParams();
2492
- }
2493
- initParams() {
2494
- if (this._propCache["src"]) {
2495
- this.setProperty("src", this._propCache["src"]);
2496
- }
2497
- if (this._propCache["paused"] == false) {
2498
- this.setProperty("paused", this._propCache["paused"]);
2499
- }
2500
- if (this._propCache["autoplay"]) {
2501
- this.setProperty("autoplay", this._propCache["autoplay"]);
2502
- }
2503
- if (this._propCache["loop"]) {
2504
- this.setProperty("loop", this._propCache["loop"]);
2505
- }
2506
- if (this._propCache["muted"]) {
2507
- this.setProperty("muted", this._propCache["muted"]);
2508
- }
2509
- }
2510
- /*******/
2511
- /** events */
2512
- addEventListener(type, listener) {
2513
- if (listener) {
2514
- this._eventListener["on" + type] = listener;
2515
- }
2516
- }
2517
- callEventListener(name, ...params) {
2518
- this._eventListener[name]?.(...params);
2519
- }
2520
- onEvent(eventStr) {
2521
- console.log("player event: ", eventStr);
2522
- let obj = JSON.parse(eventStr);
2523
- let event_obj = JSON.parse(obj.param);
2524
- let event = event_obj.event;
2525
- let data = event_obj.data;
2526
- switch (event) {
2527
- case Events.EVENT_END:
2528
- this.setProperty("paused", true);
2529
- this.callEventListener("onended");
2530
- break;
2531
- case Events.EVENT_LOAD_START:
2532
- this.callEventListener("onloadstart");
2533
- break;
2534
- case Events.EVENT_LOAD:
2535
- this.callEventListener("onloadedmetadata");
2536
- this.callEventListener("onload");
2537
- this.callEventListener("ondurationchange");
2538
- break;
2539
- case Events.EVENT_ERROR:
2540
- const Error = {
2541
- MEDIA_ERR_ABORTED: 1,
2542
- MEDIA_ERR_NETWORK: 2,
2543
- MEDIA_ERR_DECODE: 3,
2544
- MEDIA_ERR_SRC_NOT_SUPPORTED: 4,
2545
- MEDIA_ERR_NO_DECODE_RESOURCE: 6
2546
- };
2547
- const platform_error = data.error.what;
2548
- let e = Error.MEDIA_ERR_ABORTED;
2549
- switch (platform_error) {
2550
- case -1004:
2551
- e = Error.MEDIA_ERR_NETWORK;
2552
- break;
2553
- case -1007:
2554
- e = Error.MEDIA_ERR_DECODE;
2555
- break;
2556
- case -1010:
2557
- e = Error.MEDIA_ERR_SRC_NOT_SUPPORTED;
2558
- break;
2559
- case -50002:
2560
- e = Error.MEDIA_ERR_NO_DECODE_RESOURCE;
2561
- break;
2562
- }
2563
- this.callEventListener("onerror", e);
2564
- break;
2565
- case Events.EVENT_EXT:
2566
- switch (data.eventExt) {
2567
- case "videoMetadataUpdate":
2568
- this.callEventListener("onloadedmetadata");
2569
- break;
2570
- default:
2571
- logWarning("unimplentation event ext type = " + data.eventExt);
2572
- break;
2573
- }
2574
- break;
2575
- }
2576
- }
2577
- /** control */
2578
- load() {
2579
- this.setProperty("enablePlayer", true);
2580
- }
2581
- play() {
2582
- this.setProperty("paused", false);
2583
- }
2584
- pause() {
2585
- this.setProperty("paused", true);
2586
- }
2587
- unload() {
2588
- this.pause();
2589
- this.setProperty("enablePlayer", false);
2590
- }
2591
- /** audio props */
2592
- /** src 不支持get */
2593
- set src(value) {
2594
- this.setSrc(value, null);
2595
- }
2596
- /** volume */
2597
- set volume(value) {
2598
- this.setProperty("volume", value);
2599
- }
2600
- get volume() {
2601
- return this.getProperty("volume");
2602
- }
2603
- /** muted */
2604
- set muted(value) {
2605
- this.setProperty("muted", value);
2606
- }
2607
- get muted() {
2608
- return this.getProperty("muted");
2609
- }
2610
- /** loop 不支持 get*/
2611
- set loop(value) {
2612
- this.setProperty("loop", value);
2613
- }
2614
- /** paused 不支持 set */
2615
- get paused() {
2616
- return this.getProperty("paused");
2617
- }
2618
- /** autoplay 不支持 get */
2619
- set autoplay(value) {
2620
- this.setProperty("autoplay", value);
2621
- }
2622
- /** duration 不支持 set */
2623
- get duration() {
2624
- return this.getProperty("duration");
2625
- }
2626
- /** current 目前不支持时移, 只能get */
2627
- get currentTime() {
2628
- return this.getProperty("currentTime");
2629
- }
2630
- setSrc(url, head) {
2631
- if (!url) {
2632
- console.error("JsvAudio: src is null");
2633
- return;
2634
- }
2635
- let realUrl;
2636
- if (window.JsView) {
2637
- realUrl = new window.JsView.Dom.UrlRef(url).href;
2638
- } else {
2639
- realUrl = url;
2640
- }
2641
- const param = {
2642
- url: realUrl,
2643
- head: JSON.stringify(head)
2644
- };
2645
- this.setProperty("src", param);
2646
- }
2647
- setProperty(key, value) {
2648
- if (AUDIO_PROPS.hasOwnProperty(key)) {
2649
- if (checkType(value, AUDIO_PROPS[key].type)) {
2650
- console.log(TAG, "setProperty", key, value);
2651
- this._propCache[key] = value;
2652
- if (this._created) {
2653
- const param = { [key]: value };
2654
- JsvAudioBridgeProxy.SetProperty(this._playerId, JSON.stringify(param));
2655
- }
2656
- } else {
2657
- console.error(TAG, `Invalid prop: type check failed for prop "${key}". Expected ${toRawType(AUDIO_PROPS[key].type)}, got ${toRawType(value)} with value ${value}.`);
2658
- }
2659
- } else {
2660
- console.error(TAG, `property ${key} not supported`);
2661
- }
2662
- }
2663
- getProperty(key) {
2664
- if (this._created) {
2665
- const jsonStr = JsvAudioBridgeProxy.GetProperty(this._playerId, key);
2666
- if (jsonStr) {
2667
- const obj = JSON.parse(jsonStr);
2668
- return obj[key];
2669
- }
2670
- }
2671
- return null;
2672
- }
2673
- ref() {
2674
- this._ref++;
2675
- console.log("JsvAudio ref up", this._ref);
2676
- }
2677
- release() {
2678
- this._ref--;
2679
- console.log("JsvAudio release", this._ref);
2680
- if (this._ref === 0) {
2681
- window.JMD.unsubscribe(this._playerId, this._onEvent);
2682
- JsvAudioBridgeProxy.ReleasePlayer(this._playerId);
2683
- this._audioManager.releaseAudio(this._playerId);
2684
- window.JsView?.removeEventCallback(this._onVisibilityChange);
2685
- }
2686
- }
2687
- onVisibilityChange(state) {
2688
- console.log(TAG, "audio visibility change", JSON.stringify(state));
2689
- if (state.status == "show") {
2690
- if (typeof this._propCache["customerPause"] != "undefined") {
2691
- const customerPause = this._propCache["customerPause"];
2692
- delete this._propCache["customerPause"];
2693
- if (!customerPause) {
2694
- this.play();
2695
- }
2696
- }
2697
- } else {
2698
- this._propCache["customerPause"] = this._propCache["paused"];
2699
- this.pause();
2700
- }
2701
- }
2702
- //屏保开关
2703
- closeScreenSaver() {
2704
- ScreenLockManager.lock();
2705
- }
2706
- openScreenSaver() {
2707
- ScreenLockManager.unlock();
2708
- }
2709
- }
2710
- if (!window.JsView) {
2711
- const BrowserJsvAudio = await import("./BrowserAudio.28bef0de.js");
2712
- BrowserJsvAudio.default;
2713
- } else {
2714
- sPluginLoader$1.loadPlugin.bind(sPluginLoader$1);
2715
- }
2716
- let PluginInfo = {
2717
- // downloadUrl: "http://192.168.2.1:8097/pluginpackapp.zip", //插件下载地址
2718
- packageName: "com.qcode.jsvlatex",
2719
- name: "数学公式插件",
2720
- version: "1.0.4",
2721
- //插件需要的版本号
2722
- versionCodeMin: 4,
2723
- versionCodeMax: 4,
2724
- bridgeName: "jsvLatexBridge",
2725
- //插件bridge注册到jsview的名称
2726
- className: "com.qcode.jsvlatex.JsvLatex",
2727
- //插件初始化类名称
2728
- initMethod: "createInstance",
2729
- //插件初始化方法
2730
- listener: "top.JsvLatexPluginLoadResult",
2731
- //插件加载结果回调
2732
- listener2: "top.JsvLatexPluginStatus"
2733
- // debug:true,
2734
- // md5: "f8a12f63d450df862abc6dbf273e258d"
2735
- };
2736
- class JsvLatexBridgeProxy {
2737
- static GetLibPath() {
2738
- if (typeof window.jsvLatexBridge != "undefined" && typeof window.jsvLatexBridge.GetLibPath != "undefined") {
2739
- return window.jsvLatexBridge.GetLibPath();
2740
- } else {
2741
- console.error("widnow.jsvLatexBridge doesn't exist.");
2742
- return null;
2743
- }
2744
- }
2745
- }
2746
- class PluginLoader2 {
2747
- constructor() {
2748
- this.onDoneListener = [];
2749
- this.pluginLoadListener = [];
2750
- this.pluginInfo = this.getPluginInfo();
2751
- this.loadDone = false;
2752
- this.loadSucceed = false;
2753
- this.status = 0;
2754
- }
2755
- getPluginInfo() {
2756
- let info = PluginInfo;
2757
- if (typeof window.jJsvRuntimeBridge !== "undefined" && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
2758
- let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
2759
- if (plugin_base_url) {
2760
- info.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : plugin_base_url + "/") + info.packageName + "/JsvLatex-" + info.versionCodeMax + ".dat?md5=" + info.md5;
2761
- }
2762
- }
2763
- return info;
2764
- }
2765
- registerOnDoneListener(listener) {
2766
- if (listener) {
2767
- this.onDoneListener.push(listener);
2768
- }
2769
- }
2770
- getLoadInfo() {
2771
- return {
2772
- done: this.loadDone,
2773
- succeed: this.loadSucceed
2774
- };
2775
- }
2776
- /**
2777
- * listener回调处理中参数信息的说明:
2778
- * 插件加载状态回调。
2779
- * 回调函数的参数定义如下:
2780
- * 1:无法正常加载插件。
2781
- * 2:正在加载旧插件,此时插件加载过程很短,可以不用出现用户提示界面。
2782
- * 3:正在加载新插件,此时插件需要经历下载、解压等过程,用时较长,可以考虑给用户相关提示。
2783
- * 4:插件加载完成。
2784
- * 5:已加载不同版本的插件,此版本无法加载。
2785
- *
2786
- * 备注:不管插件加载处于什么状态,都可以正常使用播放器组件,播放器对象在插件未加载完成的情况下,会把相关状态保存,等完成加载后再自动下发。
2787
- */
2788
- loadPlugin(listener) {
2789
- console.log("globalLoadJsvLatexPlugin");
2790
- let plugin_status = 0;
2791
- if (typeof window.jPluginManagerBridge === "undefined" || !window.jPluginManagerBridge) {
2792
- plugin_status = 1;
2793
- } else if (this.status === 2) {
2794
- plugin_status = 2;
2795
- } else if (this.status === 3) {
2796
- plugin_status = 3;
2797
- } else if (this.status === 4) {
2798
- plugin_status = 4;
2799
- } else if (this.status === 5) {
2800
- plugin_status = 1;
2801
- }
2802
- if (plugin_status !== 0) {
2803
- if (typeof listener !== "undefined" && listener) {
2804
- setTimeout(() => {
2805
- listener(plugin_status);
2806
- }, 0);
2807
- }
2808
- return;
2809
- }
2810
- if (typeof listener !== "undefined" && listener) {
2811
- this.pluginLoadListener.push(listener);
2812
- }
2813
- if (this.status > 0) {
2814
- return;
2815
- }
2816
- this.status = 1;
2817
- window.jPluginManagerBridge.LoadPlugin(JSON.stringify(this.pluginInfo));
2818
- }
2819
- onStatusChange(status) {
2820
- console.log("JsvLatexPluginStatus: " + status);
2821
- let ret = JSON.parse(status);
2822
- let plugin_status = 2;
2823
- if (ret && ret.first_load) {
2824
- this.status = 3;
2825
- plugin_status = 3;
2826
- } else {
2827
- this.status = 2;
2828
- }
2829
- for (let i = 0; i < this.pluginLoadListener.length; i++) {
2830
- this.pluginLoadListener[i](plugin_status);
2831
- }
2832
- }
2833
- onLoadDone(result) {
2834
- console.log("JsvLatexPluginLoadResult: " + result);
2835
- this.loadDone = true;
2836
- let ret_obj = JSON.parse(result);
2837
- let plugin_status = 1;
2838
- if (ret_obj && (ret_obj.status === 4 || ret_obj.status === 1)) {
2839
- this.status = 4;
2840
- plugin_status = 4;
2841
- } else if (ret_obj && ret_obj.status === -12) {
2842
- this.status = 5;
2843
- plugin_status = 5;
2844
- } else {
2845
- this.status = 5;
2846
- }
2847
- if (this.status === 5) {
2848
- this.loadSucceed = false;
2849
- console.log("*************************JsvLatex plugin load failed, error code is " + ret_obj.status + "*************************");
2850
- } else {
2851
- this.loadSucceed = true;
2852
- }
2853
- if (window.JsView) {
2854
- const libPath = JsvLatexBridgeProxy.GetLibPath();
2855
- console.log("JsvLatex libPath", libPath);
2856
- if (libPath) {
2857
- window.JsView.loadRenderPlugin?.(
2858
- "latexPlugin",
2859
- "com.qcode.latexlib.Main",
2860
- libPath
2861
- );
2862
- } else {
2863
- console.error("JsvLatexPlugin error: get libPath failed.");
2864
- }
2865
- }
2866
- for (let i = 0; i < this.pluginLoadListener.length; i++) {
2867
- this.pluginLoadListener[i](plugin_status);
2868
- }
2869
- for (let listener of this.onDoneListener) {
2870
- listener(plugin_status);
2871
- }
2872
- }
2873
- registerGlobalListener() {
2874
- window.top.JsvLatexPluginStatus = this.onStatusChange.bind(this);
2875
- window.top.JsvLatexPluginLoadResult = this.onLoadDone.bind(this);
2876
- }
2877
- }
2878
- const sPluginLoader = new PluginLoader2();
2879
- sPluginLoader.registerGlobalListener();
2880
- if (!window.JsView) {
2881
- const BrowserJsvLatex = await import("./BrowserJsvLatex.06fbda62.js");
2882
- BrowserJsvLatex.default;
2883
- } else {
2884
- sPluginLoader.loadPlugin.bind(sPluginLoader);
2885
- }
2886
- export {
2887
- _JsvPlayer as _,
2888
- buildPreloadInfo as b
2889
- };
2890
- //# sourceMappingURL=http://localhost:57245/map/index.56197146.js.map
2891
-
2892
- /*jsvmd5:0a4c93bfac9c6bed2ac995425b88a657*/