1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <html>
- <head>
- <title>实时联动</title>
- <style>
- html, body {
- padding: 0px 0px;
- margin: 0px 0px;
- wdith: 100%;
- height: 100%;
- }
- #player {
- width: 100vw;
- height: calc(100vw * 5 / 8);
- background-color: black;
- }
- </style>
- <script src="./jquery-3.7.1.min.js"></script>
- <script src="./vconsole.min.js"></script>
- <script src="./h5player.min.js"></script>
- </head>
- <body>
- <div>v2</div>
- <div id="player"></div>
- <div>
- <input id="url" />
- <input type="button" value="播放" onclick="play()"></input>
- </div>
- <div id="msg"></div>
- <script>
- $(function () {
- $('#msg').text(window.location.href)
- var v = new VConsole();
- window.addEventListener('resize', () => {
- if(window.myPalyer) {
- window.myPalyer.JS_Resize()
- }
- })
- window.myPalyer = new window.JSPlugin({
- szId: 'player',
- szBasePath: "./",
- iMaxSplit: 1,
- iCurrentSplit: 1,
- openDebug: true,
- oStyle: {
- borderSelect: '#000',
- }
- })
- })
-
-
- function play() {
- var url = document.getElementById('url').value
- console.log(url)
- window.myPalyer.JS_Play(url, { playURL: url, mode: 0 }, 0).then(
- () => { document.getElementById('msg').innerText = 'success'; console.log('ok')},
- e => { document.getElementById('msg').innerText = e; console.log(e) }
- )
- }
- </script>
-
- </body>
- </html>
|