From 40777ae5bf655abce1d88ab681cea8fd065dd6a9 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Mon, 1 May 2017 13:59:32 -0400 Subject: [PATCH 01/95] Add note closer to top since users are trying this --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index decd0a7..83e4566 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Features: - Runs independently from any server and requires no association with YouTube (API keys, etc...). +Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the file:// site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). + - Works on all modern browsers (Chrome, Firefox, more...) as well as browsers on Android phones/tablets. ### *[Subscribe to Streamly on Reddit for updates!](https://www.reddit.com/r/StreamlyReddit/)* From 0417ba3d7bb45e4d2107abf47be5d19092b82311 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Mon, 1 May 2017 14:00:34 -0400 Subject: [PATCH 02/95] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83e4566..a91705d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Features: - Runs independently from any server and requires no association with YouTube (API keys, etc...). -Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the file:// site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). +Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the `file://` site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). - Works on all modern browsers (Chrome, Firefox, more...) as well as browsers on Android phones/tablets. From 93f9fa53ca03c0e6ceb4b904957809e9f40f4fc0 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Mon, 1 May 2017 14:07:52 -0400 Subject: [PATCH 03/95] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a91705d..d18d32a 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Features: - Puts you in charge of your playlist by saving all video information necessarry to play (name, time, video_id) with the playlist. To save your playlist, simply bookmark the open tab of Streamly or click "Save Playlist" to copy a link to your clipboard. - Runs independently from any server and requires no association with YouTube (API keys, etc...). - -Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the `file://` site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). + + Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the `file://` site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). - Works on all modern browsers (Chrome, Firefox, more...) as well as browsers on Android phones/tablets. From b7261a36b32e1faf8ff39160437acdf4115955a0 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Mon, 1 May 2017 14:08:09 -0400 Subject: [PATCH 04/95] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index d18d32a..8fcc256 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Features: - Puts you in charge of your playlist by saving all video information necessarry to play (name, time, video_id) with the playlist. To save your playlist, simply bookmark the open tab of Streamly or click "Save Playlist" to copy a link to your clipboard. - Runs independently from any server and requires no association with YouTube (API keys, etc...). - Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the `file://` site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). - Works on all modern browsers (Chrome, Firefox, more...) as well as browsers on Android phones/tablets. From d7ea3a3a7926eefbcede442f2878f87dab7d40e0 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Mon, 1 May 2017 14:08:23 -0400 Subject: [PATCH 05/95] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8fcc256..d18d32a 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Features: - Puts you in charge of your playlist by saving all video information necessarry to play (name, time, video_id) with the playlist. To save your playlist, simply bookmark the open tab of Streamly or click "Save Playlist" to copy a link to your clipboard. - Runs independently from any server and requires no association with YouTube (API keys, etc...). + Note: You may even use Streamly just stored on your computer, but likely YouTube will give you an error stating that the video creator did not allow the video to play on this site. The same will occur if you try to open a YouTube embed on your computer, as they don't recognize the `file://` site location as a valid website. You may resolve this easily by placing Streamly on a file hosting service that allows you to access the file without downloading (ie. forking on GitHub). - Works on all modern browsers (Chrome, Firefox, more...) as well as browsers on Android phones/tablets. From 38fce43a6ae957d1b64bef184774399994238675 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 14:51:08 -0400 Subject: [PATCH 06/95] start working on #282 Yay! --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index 71737b8..ad6e06e 100644 --- a/index.js +++ b/index.js @@ -825,3 +825,16 @@ document.addEventListener("drop", function(event) { document.addEventListener("dragover", function(event) { event.preventDefault(); }); + +function stationLoaded() { + var socket = io(); + socket.emit("msg", "testmessage"); +} + +function station(server) { + $.ajax({ + url: "http://" + server + "socket.io/socket.io.js", + dataType: "script", + success: stationLoaded + }); +} From a75068b4c53124904e92fdbd6057de3526eab0de Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 14:54:15 -0400 Subject: [PATCH 07/95] oops... --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ad6e06e..e7ad77c 100644 --- a/index.js +++ b/index.js @@ -833,7 +833,7 @@ function stationLoaded() { function station(server) { $.ajax({ - url: "http://" + server + "socket.io/socket.io.js", + url: "http://" + server + "/socket.io/socket.io.js", dataType: "script", success: stationLoaded }); From 24508d2d3b55fdce27385d499e9c324e146d651a Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 14:54:40 -0400 Subject: [PATCH 08/95] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e7ad77c..7f8602e 100644 --- a/index.js +++ b/index.js @@ -833,7 +833,7 @@ function stationLoaded() { function station(server) { $.ajax({ - url: "http://" + server + "/socket.io/socket.io.js", + url: server + "/socket.io/socket.io.js", dataType: "script", success: stationLoaded }); From 0716f7aca5b7fb6f7818e5e596c64281dde4f6a7 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 15:55:18 -0400 Subject: [PATCH 09/95] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7f8602e..e7ad77c 100644 --- a/index.js +++ b/index.js @@ -833,7 +833,7 @@ function stationLoaded() { function station(server) { $.ajax({ - url: server + "/socket.io/socket.io.js", + url: "http://" + server + "/socket.io/socket.io.js", dataType: "script", success: stationLoaded }); From dd7cabce56dab1d06d284e4bf119e3ee2a17eca5 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 16:53:14 -0400 Subject: [PATCH 10/95] change socket io path --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e7ad77c..a5d6dcd 100644 --- a/index.js +++ b/index.js @@ -826,14 +826,17 @@ document.addEventListener("dragover", function(event) { event.preventDefault(); }); +var stationServer; + function stationLoaded() { - var socket = io(); + var socket = io("http://" + stationServer); socket.emit("msg", "testmessage"); } function station(server) { + stationServer = server; $.ajax({ - url: "http://" + server + "/socket.io/socket.io.js", + url: "http://" + stationServer + "/socket.io/socket.io.js", dataType: "script", success: stationLoaded }); From 30f34ab63abecfc816c8904923a18c460cc4c212 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 17:15:57 -0400 Subject: [PATCH 11/95] Awe yeahe! --- index.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a5d6dcd..e32537f 100644 --- a/index.js +++ b/index.js @@ -27,6 +27,9 @@ var quickSearchQuery; var quickSearchVideos = []; var quickSearchVideosIteration = 0; +var stationServer; +var stationSocket; + var videoPaused; //this var is for addVideo knowing whether to loop to next video or not var videoPlaying; @@ -826,11 +829,17 @@ document.addEventListener("dragover", function(event) { event.preventDefault(); }); -var stationServer; +// Start Streamly Station + +function sendStation(what) { + if (stationServer !== undefined && stationServer !== null) { + stationSocket.emit("msg", what); + } +} function stationLoaded() { - var socket = io("http://" + stationServer); - socket.emit("msg", "testmessage"); + stationSocket = io("http://" + stationServer); + alert("Streamly Station \"" + stationServer + "\" connected!"); } function station(server) { @@ -841,3 +850,5 @@ function station(server) { success: stationLoaded }); } + +// End Streamly Station From 79b45712f827d1bc07318c76c373b6a65e4a7e72 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 17:24:38 -0400 Subject: [PATCH 12/95] send added video data --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e32537f..6f0db79 100644 --- a/index.js +++ b/index.js @@ -586,6 +586,8 @@ function addVideo(name, time, id) { videos[iteration] = video; } + sendStation("addvideo," + video); + if (playlistShuffle) { addedVideosWhileShuffled.push(video); } @@ -837,17 +839,17 @@ function sendStation(what) { } } -function stationLoaded() { +function loadStation() { stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); } -function station(server) { +function connectStation(server) { stationServer = server; $.ajax({ url: "http://" + stationServer + "/socket.io/socket.io.js", dataType: "script", - success: stationLoaded + success: loadStation }); } From 324c07a545b837322da8c87391517596332e1fd1 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 17:34:32 -0400 Subject: [PATCH 13/95] Lets try it out! --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index 6f0db79..c9a8fbc 100644 --- a/index.js +++ b/index.js @@ -842,6 +842,13 @@ function sendStation(what) { function loadStation() { stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); + + stationSocket.on("msg", function(msg) { + var msgData = msg.split(","); + if (msgData[0] === "addvideo") { + addVideo(msgData[1], msgData[2], msgData[3]); + } + } } function connectStation(server) { From 4b2cc3b82ee79cca9192b7799c2c8ca3a20163a2 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 17:38:22 -0400 Subject: [PATCH 14/95] oops... --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c9a8fbc..9daf3bc 100644 --- a/index.js +++ b/index.js @@ -848,7 +848,7 @@ function loadStation() { if (msgData[0] === "addvideo") { addVideo(msgData[1], msgData[2], msgData[3]); } - } + }); } function connectStation(server) { From cbe348d71649ee76c19988c1173822e9968c45c3 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 18:07:11 -0400 Subject: [PATCH 15/95] prevent infinite loop --- index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 9daf3bc..542b4e6 100644 --- a/index.js +++ b/index.js @@ -29,6 +29,7 @@ var quickSearchVideosIteration = 0; var stationServer; var stationSocket; +var lastStationSocket; var videoPaused; //this var is for addVideo knowing whether to loop to next video or not @@ -835,6 +836,7 @@ document.addEventListener("dragover", function(event) { function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { + lastStationSocket = what; stationSocket.emit("msg", what); } } @@ -844,9 +846,11 @@ function loadStation() { alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { - var msgData = msg.split(","); - if (msgData[0] === "addvideo") { - addVideo(msgData[1], msgData[2], msgData[3]); + if (msg !== lastStationSocket) { + var msgData = msg.split(","); + if (msgData[0] === "addvideo") { + addVideo(msgData[1], msgData[2], msgData[3]); + } } }); } From 8602ba90a78aa3fd789e1022dc6265cd91e29d53 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 19:49:12 -0400 Subject: [PATCH 16/95] change the way this is organized to allow functional manipulation of play and remove --- index.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 542b4e6..278d55f 100644 --- a/index.js +++ b/index.js @@ -606,17 +606,15 @@ function addVideo(name, time, id) { } } -function actionPlayVideo(element) { - var index = $(".playButton").index(element); - videoIteration = index; +function playVideo(iteration) { + videoIteration = iteration; videoPaused = false; loopVideo(); $("#favicon").attr("href", faviconPlay); } -function actionRemoveVideo(element) { - var index = $(".removeButton").index(element) + 1; - if (index === videoIteration) { +function actionRemoveVideo(iteration) { + if (iteration === videoIteration) { if (videoIteration + 1 <= videoCounter) { forwardVideo(); videoIteration = changeIteration(-1); @@ -629,7 +627,7 @@ function actionRemoveVideo(element) { videoIteration = changeIteration(-1); } } - else if (index < videoIteration) { + else if (iteration < videoIteration) { videoIteration = changeIteration(-1); } videoCounter--; @@ -642,6 +640,17 @@ function actionRemoveVideo(element) { addAutoplayVideo(); } +actionVideo(element, doWhat) { + if (doWhat === "play") { + var index = $("." + doWhat + "Button").index(element); + playVideo(index); + } + else if (doWhat === "remove") { + var index = $("." + doWhat + "Button").index(element) + 1; + removeVideo(index); + } +} + function actionMoveVideo(oldIndex, newIndex) { videos.move(oldIndex, newIndex); if (oldIndex == videoIteration) { From 76919d28046a38a4ec5714131f734590b26a82df Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 19:51:09 -0400 Subject: [PATCH 17/95] let's try it out --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 278d55f..2e34e29 100644 --- a/index.js +++ b/index.js @@ -104,8 +104,8 @@ function highlight(i, which) { function addVideoToList(name, time, spot) { name = decodeURIComponent(name); - var trElement = "" + name + "" + - "" + time + ""; + var trElement = "" + name + "" + + "" + time + ""; if ($("#videosTable > tr").length > 0) { if (spot > 1) { $("#videosTable > tr").eq(spot-2).after(trElement); @@ -640,7 +640,7 @@ function actionRemoveVideo(iteration) { addAutoplayVideo(); } -actionVideo(element, doWhat) { +function actionVideo(element, doWhat) { if (doWhat === "play") { var index = $("." + doWhat + "Button").index(element); playVideo(index); From 21b255e48c44b83b1d66865d20ca3db0663d0b0c Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 19:58:16 -0400 Subject: [PATCH 18/95] `this` is messing up the attributes in the function --- index.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 2e34e29..50bcb97 100644 --- a/index.js +++ b/index.js @@ -613,7 +613,7 @@ function playVideo(iteration) { $("#favicon").attr("href", faviconPlay); } -function actionRemoveVideo(iteration) { +function removeVideo(iteration) { if (iteration === videoIteration) { if (videoIteration + 1 <= videoCounter) { forwardVideo(); @@ -640,15 +640,13 @@ function actionRemoveVideo(iteration) { addAutoplayVideo(); } -function actionVideo(element, doWhat) { - if (doWhat === "play") { - var index = $("." + doWhat + "Button").index(element); - playVideo(index); - } - else if (doWhat === "remove") { - var index = $("." + doWhat + "Button").index(element) + 1; - removeVideo(index); - } +function actionPlayVideo(element) { + var index = $(".playButton").index(element); + playVideo(index); +} +function actionRemoveVideo(element) { + var index = $("." + doWhat + "Button").index(element) + 1; + removeVideo(index); } function actionMoveVideo(oldIndex, newIndex) { From 3d80ac7f26b0e931f111417524913adb394312fc Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 19:59:25 -0400 Subject: [PATCH 19/95] oops... --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 50bcb97..10f2322 100644 --- a/index.js +++ b/index.js @@ -104,8 +104,8 @@ function highlight(i, which) { function addVideoToList(name, time, spot) { name = decodeURIComponent(name); - var trElement = "" + name + "" + - "" + time + ""; + var trElement = "" + name + "" + + "" + time + ""; if ($("#videosTable > tr").length > 0) { if (spot > 1) { $("#videosTable > tr").eq(spot-2).after(trElement); From 18cd8e282cd193073ac79fed9124669f5e0cd2a2 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 20:03:26 -0400 Subject: [PATCH 20/95] ugh... let's try this... --- index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 10f2322..0d14b90 100644 --- a/index.js +++ b/index.js @@ -104,8 +104,8 @@ function highlight(i, which) { function addVideoToList(name, time, spot) { name = decodeURIComponent(name); - var trElement = "" + name + "" + - "" + time + ""; + var trElement = "" + name + "" + + "" + time + ""; if ($("#videosTable > tr").length > 0) { if (spot > 1) { $("#videosTable > tr").eq(spot-2).after(trElement); @@ -606,14 +606,14 @@ function addVideo(name, time, id) { } } -function playVideo(iteration) { +function actionPlayVideo(iteration) { videoIteration = iteration; videoPaused = false; loopVideo(); $("#favicon").attr("href", faviconPlay); } -function removeVideo(iteration) { +function actionRemoveVideo(iteration) { if (iteration === videoIteration) { if (videoIteration + 1 <= videoCounter) { forwardVideo(); @@ -640,13 +640,13 @@ function removeVideo(iteration) { addAutoplayVideo(); } -function actionPlayVideo(element) { +function buttonPlayVideo(element) { var index = $(".playButton").index(element); - playVideo(index); + actionPlayVideo(index); } -function actionRemoveVideo(element) { - var index = $("." + doWhat + "Button").index(element) + 1; - removeVideo(index); +function buttonRemoveVideo(element) { + var index = $(".removeButton").index(element) + 1; + actionRemoveVideo(index); } function actionMoveVideo(oldIndex, newIndex) { From 29d4ba84b284e30231149fd90369ebd308395e86 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 20:09:08 -0400 Subject: [PATCH 21/95] oops... --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0d14b90..222b3d3 100644 --- a/index.js +++ b/index.js @@ -631,8 +631,8 @@ function actionRemoveVideo(iteration) { videoIteration = changeIteration(-1); } videoCounter--; - videos.splice(index, 1); - removeVideoFromList(index, true); + videos.splice(iteration, 1); + removeVideoFromList(iteration, true); setPlaylist(); makeSortable(); From c56aba4aaaaefdc5555e61a3d5e684a1038af7c0 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 20:27:35 -0400 Subject: [PATCH 22/95] implement station quiet so as to block self sent station orders --- index.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 222b3d3..1ffb54d 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ var quickSearchVideosIteration = 0; var stationServer; var stationSocket; -var lastStationSocket; +var stationQuiet; var videoPaused; //this var is for addVideo knowing whether to loop to next video or not @@ -607,6 +607,7 @@ function addVideo(name, time, id) { } function actionPlayVideo(iteration) { + sendStation("actionplayvideo," + iteration); videoIteration = iteration; videoPaused = false; loopVideo(); @@ -614,6 +615,7 @@ function actionPlayVideo(iteration) { } function actionRemoveVideo(iteration) { + sendStation("actionremovevideo," + iteration); if (iteration === videoIteration) { if (videoIteration + 1 <= videoCounter) { forwardVideo(); @@ -845,6 +847,10 @@ function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { lastStationSocket = what; stationSocket.emit("msg", what); + stationQuiet = true; + setTimeout(function() { + stationQuiet = false; + }, 100); } } @@ -853,10 +859,18 @@ function loadStation() { alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { - if (msg !== lastStationSocket) { + if (!stationQuiet) { var msgData = msg.split(","); - if (msgData[0] === "addvideo") { - addVideo(msgData[1], msgData[2], msgData[3]); + switch (msgData[0]) { + case "addvideo": + addVideo(msgData[1], msgData[2], msgData[3]); + break; + case "actionPlayVideo": + actionPlayVideo(msgData[1]); + break; + case "actionRemoveVideo": + actionRemoveVideo(msgData[1]); + break; } } }); From 768a6dafe318ecd32bbcd0bcbf5de26805c3155d Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 22:22:14 -0400 Subject: [PATCH 23/95] probe --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1ffb54d..b166e5a 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ var quickSearchVideosIteration = 0; var stationServer; var stationSocket; -var stationQuiet; +var stationQuiet = false; var videoPaused; //this var is for addVideo knowing whether to loop to next video or not @@ -845,6 +845,7 @@ document.addEventListener("dragover", function(event) { function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { + console.log(what); lastStationSocket = what; stationSocket.emit("msg", what); stationQuiet = true; @@ -859,6 +860,7 @@ function loadStation() { alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { + console.log(msg); if (!stationQuiet) { var msgData = msg.split(","); switch (msgData[0]) { From 7a356f9a28392b27685c836ac59e1ac8779181ab Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 22:30:10 -0400 Subject: [PATCH 24/95] And then, I had my Aha! moment --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index b166e5a..10e9cad 100644 --- a/index.js +++ b/index.js @@ -867,10 +867,10 @@ function loadStation() { case "addvideo": addVideo(msgData[1], msgData[2], msgData[3]); break; - case "actionPlayVideo": + case "actionplayvideo": actionPlayVideo(msgData[1]); break; - case "actionRemoveVideo": + case "actionremovevideo": actionRemoveVideo(msgData[1]); break; } From 08dc6c5f7df244d6260ec443c868ef8555f5551b Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 23:07:49 -0400 Subject: [PATCH 25/95] add unique ids to all station messages to distinguish those that were sent by you --- index.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 10e9cad..9d2d47a 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ var quickSearchVideosIteration = 0; var stationServer; var stationSocket; -var stationQuiet = false; +var stationUniqueId; var videoPaused; //this var is for addVideo knowing whether to loop to next video or not @@ -846,32 +846,28 @@ document.addEventListener("dragover", function(event) { function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { console.log(what); - lastStationSocket = what; - stationSocket.emit("msg", what); - stationQuiet = true; - setTimeout(function() { - stationQuiet = false; - }, 100); + stationSocket.emit("msg", stationUniqueId + "," + what); } } function loadStation() { + stationUniqueId = Math.floor(Math.random()); stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { console.log(msg); - if (!stationQuiet) { - var msgData = msg.split(","); - switch (msgData[0]) { + var msgData = msg.split(","); + if (msgData[0] !== stationUniqueId) { + switch (msgData[1]) { case "addvideo": - addVideo(msgData[1], msgData[2], msgData[3]); + addVideo(msgData[2], msgData[3], msgData[4]); break; case "actionplayvideo": - actionPlayVideo(msgData[1]); + actionPlayVideo(msgData[2]); break; case "actionremovevideo": - actionRemoveVideo(msgData[1]); + actionRemoveVideo(msgData[2]); break; } } From 9f60d111df82a4647365b6136951cfab6c44a678 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 23:11:10 -0400 Subject: [PATCH 26/95] stop infinite loops while I probe --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index 9d2d47a..79e8d67 100644 --- a/index.js +++ b/index.js @@ -857,6 +857,7 @@ function loadStation() { stationSocket.on("msg", function(msg) { console.log(msg); + /**** var msgData = msg.split(","); if (msgData[0] !== stationUniqueId) { switch (msgData[1]) { @@ -871,6 +872,7 @@ function loadStation() { break; } } + ****/ }); } From b5572e6b3b7c696fc48a7e64e711c2f5a7642883 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 23:15:30 -0400 Subject: [PATCH 27/95] probe --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 79e8d67..724a09d 100644 --- a/index.js +++ b/index.js @@ -851,14 +851,15 @@ function sendStation(what) { } function loadStation() { - stationUniqueId = Math.floor(Math.random()); + stationUniqueId = Math.floor(Math.random() * 100000); stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { console.log(msg); - /**** var msgData = msg.split(","); + console.log("HERE: " + msgData[0] + " | " + stationUniqueId); + /**** if (msgData[0] !== stationUniqueId) { switch (msgData[1]) { case "addvideo": From 825ca72983ee86739665d5555155433b0844493b Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Thu, 11 May 2017 23:18:11 -0400 Subject: [PATCH 28/95] les twy it out --- index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.js b/index.js index 724a09d..bc565f8 100644 --- a/index.js +++ b/index.js @@ -859,7 +859,6 @@ function loadStation() { console.log(msg); var msgData = msg.split(","); console.log("HERE: " + msgData[0] + " | " + stationUniqueId); - /**** if (msgData[0] !== stationUniqueId) { switch (msgData[1]) { case "addvideo": @@ -873,7 +872,6 @@ function loadStation() { break; } } - ****/ }); } From 3c972d54bbec1ef0fdff4193d314c54809a05576 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 11:17:36 -0400 Subject: [PATCH 29/95] reimplement stationQuiet for duplex playlist editing capability --- index.js | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index bc565f8..589d462 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,7 @@ var quickSearchVideosIteration = 0; var stationServer; var stationSocket; -var stationUniqueId; +var stationQuiet = false; var videoPaused; //this var is for addVideo knowing whether to loop to next video or not @@ -845,32 +845,35 @@ document.addEventListener("dragover", function(event) { function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { - console.log(what); - stationSocket.emit("msg", stationUniqueId + "," + what); + if (!stationQuiet) { + console.log(what); + stationSocket.emit("msg", what); + } + else { + stationQuiet = false; + } } } function loadStation() { - stationUniqueId = Math.floor(Math.random() * 100000); stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { console.log(msg); + stationQuiet = true; + var msgData = msg.split(","); - console.log("HERE: " + msgData[0] + " | " + stationUniqueId); - if (msgData[0] !== stationUniqueId) { - switch (msgData[1]) { - case "addvideo": - addVideo(msgData[2], msgData[3], msgData[4]); - break; - case "actionplayvideo": - actionPlayVideo(msgData[2]); - break; - case "actionremovevideo": - actionRemoveVideo(msgData[2]); - break; - } + switch (msgData[0]) { + case "addvideo": + addVideo(msgData[1], msgData[2], msgData[3]); + break; + case "actionplayvideo": + actionPlayVideo(msgData[1]); + break; + case "actionremovevideo": + actionRemoveVideo(msgData[1]); + break; } }); } From beb135537c533f29502d8f2c942931cf80c4ec70 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 11:40:19 -0400 Subject: [PATCH 30/95] add stationrx/txQuiet --- index.js | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/index.js b/index.js index 589d462..f5efbd5 100644 --- a/index.js +++ b/index.js @@ -29,7 +29,8 @@ var quickSearchVideosIteration = 0; var stationServer; var stationSocket; -var stationQuiet = false; +var stationRxQuiet = false; +var stationTxQuiet = false; var videoPaused; //this var is for addVideo knowing whether to loop to next video or not @@ -845,12 +846,13 @@ document.addEventListener("dragover", function(event) { function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { - if (!stationQuiet) { + if (!stationRxQuiet) { + stationTxQuiet = true; console.log(what); stationSocket.emit("msg", what); } else { - stationQuiet = false; + stationRxQuiet = false; } } } @@ -861,19 +863,24 @@ function loadStation() { stationSocket.on("msg", function(msg) { console.log(msg); - stationQuiet = true; var msgData = msg.split(","); - switch (msgData[0]) { - case "addvideo": - addVideo(msgData[1], msgData[2], msgData[3]); - break; - case "actionplayvideo": - actionPlayVideo(msgData[1]); - break; - case "actionremovevideo": - actionRemoveVideo(msgData[1]); - break; + if (!stationTxQuiet) { + stationRxQuiet = true; + switch (msgData[0]) { + case "addvideo": + addVideo(msgData[1], msgData[2], msgData[3]); + break; + case "actionplayvideo": + actionPlayVideo(msgData[1]); + break; + case "actionremovevideo": + actionRemoveVideo(msgData[1]); + break; + } + } + else { + stationTxQuiet = false; } }); } From 18f35c695abfba4d9a8403e25f34419d0de91a19 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:02:09 -0400 Subject: [PATCH 31/95] let's see if this helps at all --- index.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f5efbd5..eeeca8d 100644 --- a/index.js +++ b/index.js @@ -872,10 +872,14 @@ function loadStation() { addVideo(msgData[1], msgData[2], msgData[3]); break; case "actionplayvideo": - actionPlayVideo(msgData[1]); + setTimeout(function() { + actionPlayVideo(msgData[1]); + }, 1000); break; case "actionremovevideo": - actionRemoveVideo(msgData[1]); + setTimeout(function() { + actionRemoveVideo(msgData[1]); + }, 1000); break; } } From f917b2888e29f749670f53bb18017466d8642a7c Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:26:29 -0400 Subject: [PATCH 32/95] probe --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index eeeca8d..47f8bb3 100644 --- a/index.js +++ b/index.js @@ -608,6 +608,7 @@ function addVideo(name, time, id) { } function actionPlayVideo(iteration) { + console.log("ACTIONPLAYVIDEO " + iteration); sendStation("actionplayvideo," + iteration); videoIteration = iteration; videoPaused = false; @@ -616,6 +617,7 @@ function actionPlayVideo(iteration) { } function actionRemoveVideo(iteration) { + console.log("ACTIONREMOVEVIDEO " + iteration); sendStation("actionremovevideo," + iteration); if (iteration === videoIteration) { if (videoIteration + 1 <= videoCounter) { From b2b6d5141c75fa1e810c68f06e22846c8af6532e Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:33:32 -0400 Subject: [PATCH 33/95] AH HAA! This was passing variable in as a string! --- index.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 47f8bb3..d863ba6 100644 --- a/index.js +++ b/index.js @@ -874,14 +874,10 @@ function loadStation() { addVideo(msgData[1], msgData[2], msgData[3]); break; case "actionplayvideo": - setTimeout(function() { - actionPlayVideo(msgData[1]); - }, 1000); + actionPlayVideo(+msgData[1]); break; case "actionremovevideo": - setTimeout(function() { - actionRemoveVideo(msgData[1]); - }, 1000); + actionRemoveVideo(+msgData[1]); break; } } From 05bfe60901834e68d73fe987cb791f147e860ccd Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:40:40 -0400 Subject: [PATCH 34/95] clean up --- index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index d863ba6..c869866 100644 --- a/index.js +++ b/index.js @@ -608,7 +608,6 @@ function addVideo(name, time, id) { } function actionPlayVideo(iteration) { - console.log("ACTIONPLAYVIDEO " + iteration); sendStation("actionplayvideo," + iteration); videoIteration = iteration; videoPaused = false; @@ -617,7 +616,6 @@ function actionPlayVideo(iteration) { } function actionRemoveVideo(iteration) { - console.log("ACTIONREMOVEVIDEO " + iteration); sendStation("actionremovevideo," + iteration); if (iteration === videoIteration) { if (videoIteration + 1 <= videoCounter) { @@ -850,7 +848,7 @@ function sendStation(what) { if (stationServer !== undefined && stationServer !== null) { if (!stationRxQuiet) { stationTxQuiet = true; - console.log(what); + console.log("Station Tx: " + what); stationSocket.emit("msg", what); } else { @@ -864,7 +862,7 @@ function loadStation() { alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { - console.log(msg); + console.log("Station Rx: " + msg); var msgData = msg.split(","); if (!stationTxQuiet) { From a243e3ce27da84b7672a1c8bafb11148655b729f Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:46:39 -0400 Subject: [PATCH 35/95] add play/pause syncing to Streamly Station --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index c869866..8c80213 100644 --- a/index.js +++ b/index.js @@ -244,11 +244,13 @@ function loopVideo() { var VideoFunctions = function() { this.play = function() { + sendStation("videofunctionsplay"); videoPaused = false; document.title = "Streamly - " + decodeURIComponent(videos[videoIteration][0]); $("#favicon").attr("href", faviconPlay); } this.pause = function() { + sendStation("videofunctionspause"); videoPaused = true; if (videos[0] !== undefined && videos[0] !== null) { document.title = "Streamly - " + decodeURIComponent(videos[0]); @@ -877,6 +879,12 @@ function loadStation() { case "actionremovevideo": actionRemoveVideo(+msgData[1]); break; + case "videofunctionsplay": + videoFunctions.play(); + break; + case "videofunctionspause": + videoFunctions.pause(); + break; } } else { From 0c1d8563dccf4621b645aec9c9d68e7e677e403e Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:50:52 -0400 Subject: [PATCH 36/95] oops... --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8c80213..4d97ead 100644 --- a/index.js +++ b/index.js @@ -880,10 +880,10 @@ function loadStation() { actionRemoveVideo(+msgData[1]); break; case "videofunctionsplay": - videoFunctions.play(); + player.playVideo(); break; case "videofunctionspause": - videoFunctions.pause(); + player.pauseVideo(); break; } } From eeac97179194f32536e8363d4ebcdae760cb58cd Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 12:56:26 -0400 Subject: [PATCH 37/95] implement previous/next video syncing in Streamly Station --- index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/index.js b/index.js index 4d97ead..e61f16f 100644 --- a/index.js +++ b/index.js @@ -262,12 +262,14 @@ var VideoFunctions = function() { var videoFunctions = new VideoFunctions(); function forwardVideo() { + sendStation("forwardvideo"); if (changeIteration(1) <= videoCounter) { loopVideo(); } } function backVideo() { + sendStation("backvideo"); if (!backRestart) { if (changeIteration(-2) > -1) { videoIteration = changeIteration(-2); @@ -879,6 +881,12 @@ function loadStation() { case "actionremovevideo": actionRemoveVideo(+msgData[1]); break; + case "forwardvideo": + forwardVideo(); + break; + case "backvideo": + backVideo(); + break; case "videofunctionsplay": player.playVideo(); break; From 23e4b375d8dedcb80b91d1b69a90b752e1768c49 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 13:23:03 -0400 Subject: [PATCH 38/95] implement all settings panel functions --- index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/index.js b/index.js index e61f16f..c35817a 100644 --- a/index.js +++ b/index.js @@ -719,20 +719,24 @@ function videoPreviews() { var PlaylistFeatures = function() { this.playNext = function() { + sendStation("playlistfeaturesplaynext"); playlistPlayNext = (playlistPlayNext ? false : true); $(".fa-arrow-circle-right").css("color", (playlistPlayNext ? "#F77F00" : "grey")); } this.repeat = function() { + sendStation("playlistfeaturesrepeat"); playlistRepeat = (playlistRepeat ? false : true); videoPreviews(); $(".fa-repeat").css("color", (playlistRepeat ? "#F77F00" : "grey")); } this.shuffle = function() { + sendStation("playlistfeaturesshuffle"); playlistShuffle = (playlistShuffle ? false : true); shufflePlaylist(); $(".fa-random").css("color", (playlistShuffle ? "#F77F00" : "grey")); } this.autoplay = function() { + sendStation("playlistfeaturesautoplay"); playlistAutoplay = (playlistAutoplay ? false : true); if (playlistAutoplay === false) { autoplayVideos = []; @@ -893,6 +897,18 @@ function loadStation() { case "videofunctionspause": player.pauseVideo(); break; + case "playlistfeaturesplaynext": + playlistFeatures.playNext(); + break; + case "playlistfeaturesrepeat": + playlistFeatures.repeat(); + break; + case "playlistfeaturesshuffle": + playlistFeatures.shuffle(); + break; + case "playlistfeaturesautoplay": + playlistFeatures.autoplay(); + break; } } else { From 87b011541af0c8278841e3235c68ee16edd84553 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 13:33:31 -0400 Subject: [PATCH 39/95] sync loopVideo to avoid compounded timing issues as per knowing one --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index c35817a..af82472 100644 --- a/index.js +++ b/index.js @@ -222,6 +222,7 @@ function playVideo() { } function loopVideo() { + sendStation("loopvideo"); if (videoIteration < videoCounter || playlistRepeat) { if (playlistShuffle && playlistRepeat && videoIteration === videoCounter) { shufflePlaylist(); @@ -879,6 +880,9 @@ function loadStation() { case "addvideo": addVideo(msgData[1], msgData[2], msgData[3]); break; + case "loopvideo": + loopVideo(); + break; case "actionplayvideo": actionPlayVideo(+msgData[1]); break; From f0324f4c715a3a3b0359fb58dbbc41a7819931e4 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 13:41:29 -0400 Subject: [PATCH 40/95] only run on video ending, not every loopvideo --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index af82472..60d090b 100644 --- a/index.js +++ b/index.js @@ -222,7 +222,6 @@ function playVideo() { } function loopVideo() { - sendStation("loopvideo"); if (videoIteration < videoCounter || playlistRepeat) { if (playlistShuffle && playlistRepeat && videoIteration === videoCounter) { shufflePlaylist(); @@ -880,7 +879,7 @@ function loadStation() { case "addvideo": addVideo(msgData[1], msgData[2], msgData[3]); break; - case "loopvideo": + case "videoending": loopVideo(); break; case "actionplayvideo": From e687ceb71dd173297c608577126324f4ef47af1c Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 13:41:59 -0400 Subject: [PATCH 41/95] playerending --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index b7ea90f..19ea30d 100644 --- a/index.html +++ b/index.html @@ -158,6 +158,7 @@

Streamly Date: Fri, 12 May 2017 14:01:42 -0400 Subject: [PATCH 42/95] oops... --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 60d090b..311cf45 100644 --- a/index.js +++ b/index.js @@ -879,7 +879,7 @@ function loadStation() { case "addvideo": addVideo(msgData[1], msgData[2], msgData[3]); break; - case "videoending": + case "playerending": loopVideo(); break; case "actionplayvideo": From a68f35ed49a7a5d2df246a4285fb5cce03df89c9 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 14:26:33 -0400 Subject: [PATCH 43/95] no need to send autoplay message since it sends new videos anyway --- index.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/index.js b/index.js index 311cf45..0396613 100644 --- a/index.js +++ b/index.js @@ -736,7 +736,6 @@ var PlaylistFeatures = function() { $(".fa-random").css("color", (playlistShuffle ? "#F77F00" : "grey")); } this.autoplay = function() { - sendStation("playlistfeaturesautoplay"); playlistAutoplay = (playlistAutoplay ? false : true); if (playlistAutoplay === false) { autoplayVideos = []; @@ -909,9 +908,6 @@ function loadStation() { case "playlistfeaturesshuffle": playlistFeatures.shuffle(); break; - case "playlistfeaturesautoplay": - playlistFeatures.autoplay(); - break; } } else { From 7f69cb96bbf4278e13d4d40188027c3b11af26f4 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 14:40:19 -0400 Subject: [PATCH 44/95] update to use cdn because of protocol security --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0396613..3773dd8 100644 --- a/index.js +++ b/index.js @@ -865,7 +865,7 @@ function sendStation(what) { } function loadStation() { - stationSocket = io("http://" + stationServer); + stationSocket = io("//" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { @@ -919,7 +919,7 @@ function loadStation() { function connectStation(server) { stationServer = server; $.ajax({ - url: "http://" + stationServer + "/socket.io/socket.io.js", + url: "https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.1/socket.io.js", dataType: "script", success: loadStation }); From 95baa06e767e13af6bcc79e942b5f580b261507e Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 15:08:09 -0400 Subject: [PATCH 45/95] I'll be amazed if this works out of the box --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 3773dd8..7146cfb 100644 --- a/index.js +++ b/index.js @@ -657,6 +657,7 @@ function buttonRemoveVideo(element) { } function actionMoveVideo(oldIndex, newIndex) { + sendStation("actionmovevideo," + oldIndex + "," + newIndex); videos.move(oldIndex, newIndex); if (oldIndex == videoIteration) { videoIteration = newIndex; @@ -908,6 +909,10 @@ function loadStation() { case "playlistfeaturesshuffle": playlistFeatures.shuffle(); break; + case "actionmovevideo": + actionMoveVideo(+msgData[2], +msgData[3]); + $("li:nth-child(" + msgData[2] + ")").append("li:nth-child(" + (msgData[3] - 1) + ")"); + break; } } else { From d92645adc7fb52e63c5c5fdc64d4e4432c30f689 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 15:10:42 -0400 Subject: [PATCH 46/95] this protocol has to be specified --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7146cfb..797f1f4 100644 --- a/index.js +++ b/index.js @@ -866,7 +866,7 @@ function sendStation(what) { } function loadStation() { - stationSocket = io("//" + stationServer); + stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); stationSocket.on("msg", function(msg) { From 269b4437722cb55e4528db1263551ad074510b9f Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Fri, 12 May 2017 15:36:56 -0400 Subject: [PATCH 47/95] NOTE: $().after() means .(THIS) goes after $(THIS) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 797f1f4..f491a95 100644 --- a/index.js +++ b/index.js @@ -911,7 +911,7 @@ function loadStation() { break; case "actionmovevideo": actionMoveVideo(+msgData[2], +msgData[3]); - $("li:nth-child(" + msgData[2] + ")").append("li:nth-child(" + (msgData[3] - 1) + ")"); + $("#videosTable tr:nth-child(" + (msgData[3] - 1) + ")").after($("#videosTable tr:nth-child(" + msgData[2] + ")")); break; } } From 673d7305e2325066e12bae48b8497f752fcc483d Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 10:23:13 -0400 Subject: [PATCH 48/95] needs to be http anyway... might as well use on-board client script --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index f491a95..89d3ec1 100644 --- a/index.js +++ b/index.js @@ -924,7 +924,7 @@ function loadStation() { function connectStation(server) { stationServer = server; $.ajax({ - url: "https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.1/socket.io.js", + url: "http://" + stationServer + "/socket.io/socket.io.js", dataType: "script", success: loadStation }); From a9f56b840218ac260543068b5ecbd55d2a4c310d Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 10:27:16 -0400 Subject: [PATCH 49/95] probe and organize --- index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 89d3ec1..b53c64d 100644 --- a/index.js +++ b/index.js @@ -911,7 +911,11 @@ function loadStation() { break; case "actionmovevideo": actionMoveVideo(+msgData[2], +msgData[3]); - $("#videosTable tr:nth-child(" + (msgData[3] - 1) + ")").after($("#videosTable tr:nth-child(" + msgData[2] + ")")); + var from = "#videosTable tr:nth-child(" + msgData[2] + ")"; + var to = "#videosTable tr:nth-child(" + (msgData[3] - 1) + ")"; + console.log("FROM: " + from); + console.log("TO: " + to); + $(to).after($(from)); break; } } From 104889ee03d32741e680746acd7595890e185fd3 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 10:57:19 -0400 Subject: [PATCH 50/95] needs to be an int --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b53c64d..280ad04 100644 --- a/index.js +++ b/index.js @@ -912,7 +912,7 @@ function loadStation() { case "actionmovevideo": actionMoveVideo(+msgData[2], +msgData[3]); var from = "#videosTable tr:nth-child(" + msgData[2] + ")"; - var to = "#videosTable tr:nth-child(" + (msgData[3] - 1) + ")"; + var to = "#videosTable tr:nth-child(" + (+msgData[3] - 1) + ")"; console.log("FROM: " + from); console.log("TO: " + to); $(to).after($(from)); From 968e7104521e7562aef0b836f1a737fa311dc6d5 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 11:05:45 -0400 Subject: [PATCH 51/95] NAN error --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 280ad04..724e75c 100644 --- a/index.js +++ b/index.js @@ -912,7 +912,8 @@ function loadStation() { case "actionmovevideo": actionMoveVideo(+msgData[2], +msgData[3]); var from = "#videosTable tr:nth-child(" + msgData[2] + ")"; - var to = "#videosTable tr:nth-child(" + (+msgData[3] - 1) + ")"; + var toIteration = msgData[3] - 1; + var to = "#videosTable tr:nth-child(" + toIteration + ")"; console.log("FROM: " + from); console.log("TO: " + to); $(to).after($(from)); From 084322075d2a1267ebf60f9aed067c0a2a8209d1 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 12:29:00 -0400 Subject: [PATCH 52/95] AHA! --- index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 724e75c..e9c1d6c 100644 --- a/index.js +++ b/index.js @@ -910,10 +910,9 @@ function loadStation() { playlistFeatures.shuffle(); break; case "actionmovevideo": - actionMoveVideo(+msgData[2], +msgData[3]); - var from = "#videosTable tr:nth-child(" + msgData[2] + ")"; - var toIteration = msgData[3] - 1; - var to = "#videosTable tr:nth-child(" + toIteration + ")"; + actionMoveVideo(+msgData[1], +msgData[2]); + var from = "#videosTable tr:nth-child(" + msgData[1] + ")"; + var to = "#videosTable tr:nth-child(" + (msgData[2] - 1) + ")"; console.log("FROM: " + from); console.log("TO: " + to); $(to).after($(from)); From a0164e528524b27f5cf7356442ae184d48eedd80 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 12:34:53 -0400 Subject: [PATCH 53/95] DONE! --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e9c1d6c..b77aa53 100644 --- a/index.js +++ b/index.js @@ -912,7 +912,7 @@ function loadStation() { case "actionmovevideo": actionMoveVideo(+msgData[1], +msgData[2]); var from = "#videosTable tr:nth-child(" + msgData[1] + ")"; - var to = "#videosTable tr:nth-child(" + (msgData[2] - 1) + ")"; + var to = "#videosTable tr:nth-child(" + msgData[2] + ")"; console.log("FROM: " + from); console.log("TO: " + to); $(to).after($(from)); From 5b2522be293bfc2d78532ef6d98598c1bc700a7c Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 12:40:00 -0400 Subject: [PATCH 54/95] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b77aa53..c84c7c8 100644 --- a/index.js +++ b/index.js @@ -911,7 +911,7 @@ function loadStation() { break; case "actionmovevideo": actionMoveVideo(+msgData[1], +msgData[2]); - var from = "#videosTable tr:nth-child(" + msgData[1] + ")"; + var from = "#videosTable tr:nth-child(" + (msgData[1] + 1) + ")"; var to = "#videosTable tr:nth-child(" + msgData[2] + ")"; console.log("FROM: " + from); console.log("TO: " + to); From cd6f06f8c3d7cd07258e58ea13c39401128dad01 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 13:52:27 -0400 Subject: [PATCH 55/95] Enter playlists by pasting them into the unibox: To this end, created an appendPlaylist function that adds the entered playlist to the current one. Les see howit workz --- index.js | 70 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index c84c7c8..65effb1 100644 --- a/index.js +++ b/index.js @@ -325,6 +325,35 @@ function getPlaylist() { } } +function appendPlaylist(playlist) { + try { + playlist = window.atob(playlist); + playlist = JSON.parse(playlist); + + if (playlist[0] !== undefined && playlist[0] !== null) { + if (videos[0] === undefined || videos[0] === null) { + $("#playlistNameBox").val(decodeURIComponent(playlist[0])); + } + } + + for (var i = 1; i < playlist.length; i++) { + videoCounter = videoCounter + i; + var printTime = msConversion(playlist[videoCounter][1] * 1000); + addVideoToList(playlist[videoCounter][0], printTime, videoCounter); + } + + playlist.splice(0, 1); + videos = videos.concat(playlist); + + setPlaylist(); + } + catch(err) { + alert("Uh oh... It looks like this playlist URL is broken, however, you may still be able to retrieve your data.\n\n" + + "Make sure that you save the URL that you have now, and contact me (the administrator) by submitting an issue on Streamly's Github page.\n\n" + + "I'm really sorry about this inconvenience.\n\nerr: " + err); + } +} + var dataPlayerRunning = false; function getVideoData(id) { console.log("getVideoData dataPlayerRunning=" + dataPlayerRunning + " videoId=" + videoId + " id=" + id); @@ -754,10 +783,26 @@ var PlaylistFeatures = function() { var playlistFeatures = new PlaylistFeatures; function urlValidate(url) { - var regex = /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube.com\/embed\/)([^?&]+)/i; - url = url.match(regex); - if (url !== null && url[1] !== null) { - return url[1]; + var youtubeRegex = /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube.com\/embed\/)([^?&]+)/i; + var streamlyRegex = /.*#(.+)/i; + + function checkMatch(url, regex) { + var doesMatch = url.match(regex); + if (doesMatch !== null && doesMatch[1] !== null) { + return doesMatch[1]; + } + else { + return false; + } + } + + var checkoutYoutube = checkMatch(url, youtubeRegex); + var checkoutStreamly = checkMatch(url, streamlyRegex); + if (checkoutYoutube) { + return ["youtube", checkout]; + } + else if (checkoutStreamly) { + return ["streamly", checkout]; } else { return false; @@ -802,13 +847,18 @@ function input(type) { } } else if (isUrl) { - inputBox = isUrl; - getVideoData(inputBox); - $("#inputBox").val("").attr("placeholder", loadingPlaceholder); - if (typeof popup !== "undefined") { - popup.close(); + if (isUrl[0] === "youtube") { + inputBox = isUrl; + getVideoData(inputBox); + $("#inputBox").val("").attr("placeholder", loadingPlaceholder); + if (typeof popup !== "undefined") { + popup.close(); + } + $("#youtube").css("display", "block"); + } + else if (isUrl[0] === "streamly") { + appendPlaylist(isUrl[1]); } - $("#youtube").css("display", "block"); } else if ($(window).width() > 600 && inputBox.indexOf("\\") === -1) { if (inputBox.slice(-2) === " l") { From 808632b396aa3a49478811427a24cdece3dd7cc4 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 13:56:24 -0400 Subject: [PATCH 56/95] debuggy --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 65effb1..36388ed 100644 --- a/index.js +++ b/index.js @@ -799,10 +799,10 @@ function urlValidate(url) { var checkoutYoutube = checkMatch(url, youtubeRegex); var checkoutStreamly = checkMatch(url, streamlyRegex); if (checkoutYoutube) { - return ["youtube", checkout]; + return ["youtube", checkoutYoutube]; } else if (checkoutStreamly) { - return ["streamly", checkout]; + return ["streamly", checkoutStreamly]; } else { return false; From 4ef49b1ed838c3212606c9d7e112c420edfec36e Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 14:10:29 -0400 Subject: [PATCH 57/95] debuggying --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 36388ed..68c969b 100644 --- a/index.js +++ b/index.js @@ -338,8 +338,8 @@ function appendPlaylist(playlist) { for (var i = 1; i < playlist.length; i++) { videoCounter = videoCounter + i; - var printTime = msConversion(playlist[videoCounter][1] * 1000); - addVideoToList(playlist[videoCounter][0], printTime, videoCounter); + var printTime = msConversion(playlist[i][1] * 1000); + addVideoToList(playlist[i][0], printTime, videoCounter); } playlist.splice(0, 1); From 3406f961832b1ab396aeb0566fdeed52c246bb09 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 14:16:37 -0400 Subject: [PATCH 58/95] debuggling --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 68c969b..73b8ce8 100644 --- a/index.js +++ b/index.js @@ -337,7 +337,7 @@ function appendPlaylist(playlist) { } for (var i = 1; i < playlist.length; i++) { - videoCounter = videoCounter + i; + videoCounter++; var printTime = msConversion(playlist[i][1] * 1000); addVideoToList(playlist[i][0], printTime, videoCounter); } From ebb6d898fcc2037c152f0790fb5c065d8c06cb55 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 16:40:53 -0400 Subject: [PATCH 59/95] clear the text box, and we're good to go! --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 73b8ce8..5ed4deb 100644 --- a/index.js +++ b/index.js @@ -858,6 +858,7 @@ function input(type) { } else if (isUrl[0] === "streamly") { appendPlaylist(isUrl[1]); + $("#inputBox").val("").attr("placeholder", placeholder); } } else if ($(window).width() > 600 && inputBox.indexOf("\\") === -1) { From 50012b738fb6d210184058acea7b863ca2d85d83 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 18:36:24 -0400 Subject: [PATCH 60/95] add settings window and settings shadow --- styles.css | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/styles.css b/styles.css index 3a85324..d0ad891 100644 --- a/styles.css +++ b/styles.css @@ -90,6 +90,27 @@ footer { left: 35px; color: #fff; } +#settingsWindow { + width: 600px; + position: fixed; + background: grey; + height: 400px; + z-index: 3; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: #2b2b2b; +} +#settingsShadow { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 2; + background: black; + background-color: rgba(0, 0, 0, 0.75); +} td, th, #main, From 4fa033cab9a73e6d1f81614af0e129c3b6f54873 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 18:39:07 -0400 Subject: [PATCH 61/95] add settings panel --- index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 19ea30d..4dba76f 100644 --- a/index.html +++ b/index.html @@ -26,9 +26,13 @@

Streamly - +

Settings

+

Streamly Station

+ + +
From 4244ca3870a1e505913d07e45c2546755cc9b2a6 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 19:03:13 -0400 Subject: [PATCH 64/95] create actionConnectStation --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 5ed4deb..9750898 100644 --- a/index.js +++ b/index.js @@ -985,4 +985,9 @@ function connectStation(server) { }); } +function actionConnectStation() { + var station = $("#connectStation").val(); + connectStation(station); +} + // End Streamly Station From 7f78386690655b9b5f542b7dca2568180e10a0bb Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 19:08:46 -0400 Subject: [PATCH 65/95] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index d4158aa..12e5f3e 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@

Streamly Settings

Streamly Station

- +
From e18d9c50cf24a2eaed70d92f5abc63e3c4b04cb1 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 19:10:43 -0400 Subject: [PATCH 66/95] Update styles.css --- styles.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/styles.css b/styles.css index 11e7fd6..825ce1a 100644 --- a/styles.css +++ b/styles.css @@ -114,6 +114,10 @@ footer { background: black; background-color: rgba(0, 0, 0, 0.75); } +#connectStationBox { + width: 350px; + font-family: 'Roboto',sans-serif; +} td, th, #main, From 76f67cd1edcb9feaef43cc14ed54be1564a16afa Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 19:11:38 -0400 Subject: [PATCH 67/95] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9750898..67e9935 100644 --- a/index.js +++ b/index.js @@ -986,7 +986,7 @@ function connectStation(server) { } function actionConnectStation() { - var station = $("#connectStation").val(); + var station = $("#connectStationBox").val(); connectStation(station); } From 46175db00e4211634ae85d1b042e16ccfe7c0eb4 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 19:53:51 -0400 Subject: [PATCH 68/95] Update index.html --- index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 12e5f3e..c85b1e4 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,7 @@

Streamly
+
Close

Settings

Streamly Station

@@ -126,8 +127,13 @@

Streamly Station

$("#playlistNameBox").on("blur", function() { input(2); }); + + function openSettings() { + $("#settingsWindow").css("display", "block"); + $("#settingsShadow").css("display", "block"); + } - function startVideoProgress() { + function startVideoProgress() { if (!videoPaused) { actionTimers.clear(); videoProgress(); From 3601c843af94193c594d710c0f5be4591021285c Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sat, 13 May 2017 19:54:35 -0400 Subject: [PATCH 69/95] Update styles.css --- styles.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/styles.css b/styles.css index 825ce1a..13f3e45 100644 --- a/styles.css +++ b/styles.css @@ -103,6 +103,7 @@ footer { text-align: left; padding: 10px; color: #ccc; + display: none; } #settingsShadow { position: fixed; @@ -113,6 +114,7 @@ footer { z-index: 2; background: black; background-color: rgba(0, 0, 0, 0.75); + display: none; } #connectStationBox { width: 350px; From 563d4e00b205191b16befc1d9af2b5f1b809db9b Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:00:10 -0400 Subject: [PATCH 70/95] Update index.html --- index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.html b/index.html index c85b1e4..8ce694c 100644 --- a/index.html +++ b/index.html @@ -132,6 +132,10 @@

Streamly Station

$("#settingsWindow").css("display", "block"); $("#settingsShadow").css("display", "block"); } + function closeSettings() { + $("#settingsWindow").css("display", "none"); + $("#settingsShadow").css("display", "none"); + } function startVideoProgress() { if (!videoPaused) { From 40b0b347a2d1f7713d0452d3066c339c9c83c48d Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:10:54 -0400 Subject: [PATCH 71/95] added settingsclosebutton styling --- styles.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/styles.css b/styles.css index 13f3e45..ee1c175 100644 --- a/styles.css +++ b/styles.css @@ -90,6 +90,16 @@ footer { left: 35px; color: #fff; } +#settingsCloseButton { + position: absolute; + top: 0; + right: 0; + cursor: pointer; + padding: 10px; +} +#settingsCloseButton:hover { + color: white; +} #settingsWindow { width: 600px; position: fixed; From 0d27444b21fc0343b18b9a250810a6708a9a1c63 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:12:26 -0400 Subject: [PATCH 72/95] finish the settings close button --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 8ce694c..036c14f 100644 --- a/index.html +++ b/index.html @@ -31,7 +31,7 @@

Streamly
-
Close
+
Close

Settings

Streamly Station

From ca11d0e75b39635bd14158d0a283f303aed33e9e Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:25:31 -0400 Subject: [PATCH 73/95] move settings button to just after the logo when on mobile --- index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.html b/index.html index 036c14f..884affc 100644 --- a/index.html +++ b/index.html @@ -136,6 +136,9 @@

Streamly Station

$("#settingsWindow").css("display", "none"); $("#settingsShadow").css("display", "none"); } + if ($(window).width() <= 600) { + $("#title").after("#settingsButton") + } function startVideoProgress() { if (!videoPaused) { From 9c22b77ff883a86ffe10c255c7aa5ec4ec01142f Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:29:34 -0400 Subject: [PATCH 74/95] add mobile styling to settings cog --- styles.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/styles.css b/styles.css index ee1c175..59b979e 100644 --- a/styles.css +++ b/styles.css @@ -377,10 +377,16 @@ tr.placeholder:before { header { height: auto !important; } - #inputBox, #saveButton, #settingsButton { + #inputBox, #saveButton { position: initial; margin-bottom: 5px; } + #settingsButton { + position: absolute; + top: 10px; + right: 10px; + color: #fff; + } #inputBox { width: calc(100% - 120px) !important; } From 95a4d90f09e30834847a2c68d21eaa90092b882f Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:33:35 -0400 Subject: [PATCH 75/95] oops... --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 884affc..627e4ea 100644 --- a/index.html +++ b/index.html @@ -137,7 +137,7 @@

Streamly Station

$("#settingsShadow").css("display", "none"); } if ($(window).width() <= 600) { - $("#title").after("#settingsButton") + $("#title").after($("#settingsButton")); } function startVideoProgress() { From 33535b4c02d667fc5fd0a021091d0fcbd3edb089 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:39:29 -0400 Subject: [PATCH 76/95] clean up --- styles.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/styles.css b/styles.css index 59b979e..4627d9b 100644 --- a/styles.css +++ b/styles.css @@ -382,9 +382,9 @@ tr.placeholder:before { margin-bottom: 5px; } #settingsButton { - position: absolute; - top: 10px; - right: 10px; + float: right; + padding: 10px; + left: auto; color: #fff; } #inputBox { From 7470de08c5de03fbb1265caa3c21b2d7614cadb8 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 12:42:11 -0400 Subject: [PATCH 77/95] Update styles.css --- styles.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/styles.css b/styles.css index 4627d9b..9c0eccc 100644 --- a/styles.css +++ b/styles.css @@ -387,6 +387,9 @@ tr.placeholder:before { left: auto; color: #fff; } + #settingsWindow { + width: auto; + } #inputBox { width: calc(100% - 120px) !important; } From 023c40cf81c70dcfbb4b80103a1657c5c8ac30c0 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 13:20:47 -0400 Subject: [PATCH 78/95] add security warning --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 67e9935..45f7da0 100644 --- a/index.js +++ b/index.js @@ -987,6 +987,11 @@ function connectStation(server) { function actionConnectStation() { var station = $("#connectStationBox").val(); + if (window.location.protocol === "https:") { + alert("Note: Due to security protections, scripts on secured pages with 'https://' cannot make unsecured connections.\n" + + "Streamly Station runs without any onboard security, so this request will probably be blocked.\n" + + "In order to use Streamly Station, please replace the 'https://' with 'http://' in the URL."); + } connectStation(station); } From f43a667a545ac5352256ec6f3ee46fb531c881a3 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 13:26:57 -0400 Subject: [PATCH 79/95] make notification clearer --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 45f7da0..3d75bd3 100644 --- a/index.js +++ b/index.js @@ -988,9 +988,9 @@ function connectStation(server) { function actionConnectStation() { var station = $("#connectStationBox").val(); if (window.location.protocol === "https:") { - alert("Note: Due to security protections, scripts on secured pages with 'https://' cannot make unsecured connections.\n" + - "Streamly Station runs without any onboard security, so this request will probably be blocked.\n" + - "In order to use Streamly Station, please replace the 'https://' with 'http://' in the URL."); + alert("Note: Due to security protections, scripts on secured pages with 'https://' cannot make unsecured connections. " + + "Streamly Station runs without any onboard security, so this request will probably be blocked and you'll get a notification that the site requested unsecured scripts.\n\n" + + "In order to use Streamly Station, either make an exception to 'Load unsafe scripts' or replace the 'https://' with 'http://' in the URL."); } connectStation(station); } From a44b93a223e9f1f928d097ca0543d8f40b3cfe22 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 14:36:38 -0400 Subject: [PATCH 80/95] needs to be int --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3d75bd3..7785e67 100644 --- a/index.js +++ b/index.js @@ -962,7 +962,7 @@ function loadStation() { break; case "actionmovevideo": actionMoveVideo(+msgData[1], +msgData[2]); - var from = "#videosTable tr:nth-child(" + (msgData[1] + 1) + ")"; + var from = "#videosTable tr:nth-child(" + (+msgData[1] + 1) + ")"; var to = "#videosTable tr:nth-child(" + msgData[2] + ")"; console.log("FROM: " + from); console.log("TO: " + to); From 66dfab0b36b8150311a128637f03265d27993258 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 14:43:24 -0400 Subject: [PATCH 81/95] style up the settings window --- index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 627e4ea..5d2be79 100644 --- a/index.html +++ b/index.html @@ -32,9 +32,11 @@

Streamly

Close
-

Settings

-

Streamly Station

+

Settings


+

Streamly Station


+

Connect to a Streamly Station

+
From 89c4ac8c60085ecc3bb8d9c4e8522afce8af45d8 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 14:45:34 -0400 Subject: [PATCH 82/95] Update index.html --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5d2be79..9d469ff 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@

Streamly Close

Settings


Streamly Station


-

Connect to a Streamly Station

+

Connect to a Streamly Station

From 7320f473829982c66e3bd11d84940ca1d545895f Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 14:46:32 -0400 Subject: [PATCH 83/95] Update styles.css --- styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styles.css b/styles.css index 9c0eccc..c6ab2eb 100644 --- a/styles.css +++ b/styles.css @@ -127,7 +127,7 @@ footer { display: none; } #connectStationBox { - width: 350px; + width: 75%; font-family: 'Roboto',sans-serif; } td, From c479d865d25958d07d7fcae7d93ebc14c28f70d5 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 21:37:12 -0400 Subject: [PATCH 84/95] add station status icon --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index 9d469ff..c3e0b36 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,7 @@

Streamly +
From 51baf38228216871baae54a003512ef49875b8c9 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 21:43:29 -0400 Subject: [PATCH 85/95] add station status icon css --- styles.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/styles.css b/styles.css index c6ab2eb..2552b6a 100644 --- a/styles.css +++ b/styles.css @@ -90,6 +90,11 @@ footer { left: 35px; color: #fff; } +#stationIcon { + color: #00ff00; + left: 50px; + display: none; +} #settingsCloseButton { position: absolute; top: 0; From 6be40f5e520c24fc1f014d391ebddd1501297c03 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 21:49:15 -0400 Subject: [PATCH 86/95] update styling to inputBox for more standard handling --- styles.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/styles.css b/styles.css index 2552b6a..5154089 100644 --- a/styles.css +++ b/styles.css @@ -74,7 +74,8 @@ footer { border-radius: 999px; left: 15px; padding: 5px; - width: 50%; + width: calc(100% - 450px); + max-width: 600px; } #saveButton, #settingsButton { @@ -92,7 +93,8 @@ footer { } #stationIcon { color: #00ff00; - left: 50px; + left: 45px; + position: relative; display: none; } #settingsCloseButton { From 1bea06c789197c4c42b0ffdcc1ba7923aeb3b42d Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 22:14:00 -0400 Subject: [PATCH 87/95] Update index.html --- index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/index.html b/index.html index c3e0b36..3a830e2 100644 --- a/index.html +++ b/index.html @@ -141,6 +141,7 @@

Streamly Station


} if ($(window).width() <= 600) { $("#title").after($("#settingsButton")); + $("#settingsButton").after($("#stationIcon")); } function startVideoProgress() { From f90b255d8857849fff482b399121f3f45bda057b Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 22:16:38 -0400 Subject: [PATCH 88/95] Update styles.css --- styles.css | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/styles.css b/styles.css index 5154089..98bd0e4 100644 --- a/styles.css +++ b/styles.css @@ -94,7 +94,6 @@ footer { #stationIcon { color: #00ff00; left: 45px; - position: relative; display: none; } #settingsCloseButton { @@ -388,11 +387,11 @@ tr.placeholder:before { position: initial; margin-bottom: 5px; } - #settingsButton { + #settingsButton, + #stationIcon { float: right; padding: 10px; left: auto; - color: #fff; } #settingsWindow { width: auto; From 93d4784d0763cdc306639f832ccd25abb214f80e Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 22:19:13 -0400 Subject: [PATCH 89/95] Update styles.css --- styles.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/styles.css b/styles.css index 98bd0e4..3f6a86d 100644 --- a/styles.css +++ b/styles.css @@ -86,6 +86,10 @@ footer { padding: 5px 7px; background-color: #fff; } +#settingsButton, +#stationIcon { + position: relative; +} #settingsButton { top: 1px; left: 35px; From 7ba50429bbf57baefb2153d77aed228de469fd7f Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 23:23:09 -0400 Subject: [PATCH 90/95] implement station icon --- index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/index.js b/index.js index 7785e67..850fe7b 100644 --- a/index.js +++ b/index.js @@ -920,12 +920,20 @@ function loadStation() { stationSocket = io("http://" + stationServer); alert("Streamly Station \"" + stationServer + "\" connected!"); + $("#stationIcon").css("display", "initial"); + stationSocket.on("msg", function(msg) { console.log("Station Rx: " + msg); var msgData = msg.split(","); if (!stationTxQuiet) { stationRxQuiet = true; + + $("#stationIcon").css("color", "red"); + setTimeout(function() { + $("#stationIcon").css("color", "#00ff00"); + }, 1000); + switch (msgData[0]) { case "addvideo": addVideo(msgData[1], msgData[2], msgData[3]); @@ -985,6 +993,11 @@ function connectStation(server) { }); } +function disconnectStation() { + stationSocket.disconnect(); + $("#stationIcon").css("display", "none"); +} + function actionConnectStation() { var station = $("#connectStationBox").val(); if (window.location.protocol === "https:") { From f8e22ddfb4ee644035540f99ff71c089e6de0fc2 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 23:29:52 -0400 Subject: [PATCH 91/95] make it quicker --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 850fe7b..5b1b06d 100644 --- a/index.js +++ b/index.js @@ -932,7 +932,7 @@ function loadStation() { $("#stationIcon").css("color", "red"); setTimeout(function() { $("#stationIcon").css("color", "#00ff00"); - }, 1000); + }, 300); switch (msgData[0]) { case "addvideo": From 7168d3c5dd4652cad90d9ab3339674875946a77c Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 23:31:18 -0400 Subject: [PATCH 92/95] change message on icon --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3a830e2..291c942 100644 --- a/index.html +++ b/index.html @@ -27,7 +27,7 @@

Streamly - +
From 6eb0155ce544378d437f61f7feef1686a0de6ee0 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 23:32:25 -0400 Subject: [PATCH 93/95] Update styles.css --- styles.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/styles.css b/styles.css index 3f6a86d..d9741a1 100644 --- a/styles.css +++ b/styles.css @@ -78,7 +78,8 @@ footer { max-width: 600px; } #saveButton, -#settingsButton { +#settingsButton, +#stationIcon { cursor: pointer; } #saveButton { From 34fd43720dec4cd862f1695e54d147172e673881 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 23:34:43 -0400 Subject: [PATCH 94/95] only show security warning once --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 5b1b06d..437854e 100644 --- a/index.js +++ b/index.js @@ -998,9 +998,11 @@ function disconnectStation() { $("#stationIcon").css("display", "none"); } +var securityWarning = false; function actionConnectStation() { var station = $("#connectStationBox").val(); - if (window.location.protocol === "https:") { + if (window.location.protocol === "https:" && securityWarning === false) { + securityWarning = true; alert("Note: Due to security protections, scripts on secured pages with 'https://' cannot make unsecured connections. " + "Streamly Station runs without any onboard security, so this request will probably be blocked and you'll get a notification that the site requested unsecured scripts.\n\n" + "In order to use Streamly Station, either make an exception to 'Load unsafe scripts' or replace the 'https://' with 'http://' in the URL."); From f1863e97b141070ff1274904433d37ef04a49c51 Mon Sep 17 00:00:00 2001 From: LNFWebsite Date: Sun, 14 May 2017 23:38:06 -0400 Subject: [PATCH 95/95] debug --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 437854e..20bd8b5 100644 --- a/index.js +++ b/index.js @@ -848,7 +848,7 @@ function input(type) { } else if (isUrl) { if (isUrl[0] === "youtube") { - inputBox = isUrl; + inputBox = isUrl[1]; getVideoData(inputBox); $("#inputBox").val("").attr("placeholder", loadingPlaceholder); if (typeof popup !== "undefined") {