Skip to content

Instantly share code, notes, and snippets.

@djmason9
Created April 3, 2018 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djmason9/91e04e4ceec28016e34e9f966abfa59e to your computer and use it in GitHub Desktop.
Save djmason9/91e04e4ceec28016e34e9f966abfa59e to your computer and use it in GitHub Desktop.
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