player.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <html>
  2. <head>
  3. <title>实时联动</title>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  5. <link rel="stylesheet" type="text/css" href="./style.css">
  6. <script src="./jquery-3.7.1.min.js"></script>
  7. <script src="./vconsole.min.js"></script>
  8. <script src="./h5player.min.js"></script>
  9. <script src="./utils.js"></script>
  10. </head>
  11. <body>
  12. <div class="box">
  13. <select id="orgSelect" class="orgSelect"></select>
  14. <div>
  15. <input id="url" />
  16. <input type="button" value="播放" onclick="play()"></input>
  17. </div>
  18. <div id="msg"></div>
  19. </div>
  20. <script>
  21. $(function () {
  22. var v = new VConsole();
  23. var token = getQueryParams('token')
  24. var base = getQueryParams('base')
  25. var boxWidth = $('.box').width()
  26. var playerHeight = boxWidth * 5 / 8
  27. getOrgOptions(base, token)
  28. $('#orgSelect').on('change', function (e) {
  29. var orgId = e.target.value
  30. getPlayUrl(base, token, orgId, function(list) {
  31. for(var i = 0; i < 5 ; i ++) {
  32. var playerDiv = $('<div></div>');
  33. playerDiv.css({
  34. 'width': boxWidth + 'px',
  35. 'height': playerHeight + 'px',
  36. 'margin-top': '5px';
  37. 'background-color': 'lightblue',
  38. 'border': '1px solid black'
  39. })
  40. $('.box').append(playerDiv)
  41. }
  42. })
  43. })
  44. // window.myPalyer = new window.JSPlugin({
  45. // szId: 'player',
  46. // szBasePath: "./",
  47. // iMaxSplit: 1,
  48. // iCurrentSplit: 1,
  49. // openDebug: true,
  50. // oStyle: {
  51. // borderSelect: '#000',
  52. // }
  53. // })
  54. })
  55. function play() {
  56. var url = document.getElementById('url').value
  57. console.log(url)
  58. window.myPalyer.JS_Play(url, { playURL: url, mode: 0 }, 0).then(
  59. () => { document.getElementById('msg').innerText = 'success'; console.log('ok')},
  60. e => { document.getElementById('msg').innerText = e; console.log(e) }
  61. )
  62. }
  63. </script>
  64. </body>
  65. </html>