Skip to content

Instantly share code, notes, and snippets.

@djmason9

djmason9/player.js

Created Apr 3, 2018
Embed
What would you like to do?
var socket = io.connect("http://mydomain.ngrok.io.ngrok.io");
document.addEventListener("DOMContentLoaded", function(event) {
var media = document.querySelector('video');
socket.on("doPlayLocal", function (data) {
console.log("doPlayLocal called")
media.play();
});
socket.on("doStopLocal", function (data) {
console.log("doStopLocal called")
media.pause();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment