aboutsummaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'index.html')
-rw-r--r--index.html21
1 files changed, 11 insertions, 10 deletions
diff --git a/index.html b/index.html
index 9f88bb2..f01ad13 100644
--- a/index.html
+++ b/index.html
@@ -20,17 +20,8 @@
pc.addTransceiver('video', {direction: 'recvonly'});
pc.addTransceiver('audio', {direction: 'recvonly'});
- window.seekClick = () => {
- conn.send(JSON.stringify({event: 'seek', data: document.getElementById('seekTime').value}))
- }
- window.playClick = () => {
- conn.send(JSON.stringify({event: 'play', data: ''}))
- }
- window.pauseClick = () => {
- conn.send(JSON.stringify({event: 'pause', data: ''}))
- }
-
pc.ontrack = function (event) {
+ console.log('got track',event.track);
if (event.track.kind === 'audio') {
return
}
@@ -43,6 +34,16 @@
let conn = new WebSocket('wss://' + window.location.host + window.location.pathname + '/ws/')
window.conn = conn
+ window.seekClick = () => {
+ conn.send(JSON.stringify({event: 'seek', data: document.getElementById('seekTime').value}))
+ }
+ window.playClick = () => {
+ conn.send(JSON.stringify({event: 'play', data: ''}))
+ }
+ window.pauseClick = () => {
+ conn.send(JSON.stringify({event: 'pause', data: ''}))
+ }
+
conn.onopen = () => {
console.log('Connection opened')
}