import {SrsRTC } from './SrsRTC.js'; import { Connection } from './connection.js'; const sdk = new SrsRTC(); const testConfig ={ userId: '11111', roomId: '111', } const connection =new Connection(testConfig); console.log('sdk',sdk) console.log('sdk',connection) connection.socket.emit('pushVideo',{ videoList:['0-1-0'], videoId: 'mini' }) connection.socket.on('getVideo',(videoId)=>{ console.log('getVideo',videoId) if(videoId){ const steamUrl ='webrtc://demo-kms.4dage.com/live/' + videoId getVideo(steamUrl) } }) const getVideo =(videoUrl)=>{ $('#testVideoFeed').prop('srcObject', sdk.stream); sdk.getVideo(videoUrl).then(function(session){ console.log('session',session.sessionid) }).catch(function (reason) { console.error(reason); }) } // sdk.pc.ondatachannel = function(ev) { // console.log('Data channel is created!'); // ev.channel.onopen = function() { // console.log('Data channel is open and ready to be used.'); // }; // };