player.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <html>
  2. <head>
  3. <title>实时联动</title>
  4. <style>
  5. html, body {
  6. padding: 0px 0px;
  7. margin: 0px 0px;
  8. wdith: 100%;
  9. height: 100%;
  10. }
  11. #player {
  12. width: 100vw;
  13. height: calc(100vw * 5 / 8);
  14. background-color: black;
  15. }
  16. </style>
  17. <script src="./jquery-3.7.1.min.js"></script>
  18. <script src="./vconsole.min.js"></script>
  19. <script src="./h5player.min.js"></script>
  20. </head>
  21. <body>
  22. <div>v2</div>
  23. <div id="player"></div>
  24. <div>
  25. <input id="url" />
  26. <input type="button" value="播放" onclick="play()"></input>
  27. </div>
  28. <div id="msg"></div>
  29. <script>
  30. $(function () {
  31. $('#msg').text(window.location.href)
  32. var v = new VConsole();
  33. window.addEventListener('resize', () => {
  34. if(window.myPalyer) {
  35. window.myPalyer.JS_Resize()
  36. }
  37. })
  38. window.myPalyer = new window.JSPlugin({
  39. szId: 'player',
  40. szBasePath: "./",
  41. iMaxSplit: 1,
  42. iCurrentSplit: 1,
  43. openDebug: true,
  44. oStyle: {
  45. borderSelect: '#000',
  46. }
  47. })
  48. })
  49. function play() {
  50. var url = document.getElementById('url').value
  51. console.log(url)
  52. window.myPalyer.JS_Play(url, { playURL: url, mode: 0 }, 0).then(
  53. () => { document.getElementById('msg').innerText = 'success'; console.log('ok')},
  54. e => { document.getElementById('msg').innerText = e; console.log(e) }
  55. )
  56. }
  57. </script>
  58. </body>
  59. </html>