123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <html>
- <head>
- <title>实时联动</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
- <link rel="stylesheet" type="text/css" href="./style.css">
- <script src="./jquery-3.7.1.min.js"></script>
- <script src="./vconsole.min.js"></script>
- <script src="./h5player.min.js"></script>
- <script src="./utils.js"></script>
- </head>
- <body>
- <div class="box">
- <select id="orgSelect" class="orgSelect"></select>
- <div>
- <input id="url" />
- <input type="button" value="播放" onclick="play()"></input>
- </div>
- <div id="msg"></div>
- </div>
- <script>
- $(function () {
- var v = new VConsole();
- var token = getQueryParams('token')
- var base = getQueryParams('base')
- var boxWidth = $('.box').width()
- var playerHeight = boxWidth * 5 / 8
- getOrgOptions(base, token)
- $('#orgSelect').on('change', function (e) {
- var orgId = e.target.value
- getPlayUrl(base, token, orgId, function(list) {
- for(var i = 0; i < 5 ; i ++) {
- var playerDiv = $('<div></div>');
- playerDiv.css({
- 'width': boxWidth + 'px',
- 'height': playerHeight + 'px',
- 'margin-top': '5px';
- 'background-color': 'lightblue',
- 'border': '1px solid black'
- })
- $('.box').append(playerDiv)
- }
- })
- })
- // 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>
|