diff --git a/media.js b/media.js index d13e1da2..0f04b7e0 100644 --- a/media.js +++ b/media.js @@ -93,10 +93,11 @@ Media.prototype.fullupdate = function() { } Media.prototype.timeupdate = function() { - return this.fullupdate(); - //return { - // currentTime: this.currentTime - //}; + //return this.fullupdate(); + return { + currentTime: this.currentTime, + paused: this.paused + }; } exports.Media = Media; diff --git a/package.json b/package.json index 0c7682b4..4b3dc379 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "1.7.2", + "version": "1.7.3", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/server.js b/server.js index 34c0ae15..31799092 100644 --- a/server.js +++ b/server.js @@ -9,7 +9,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -const VERSION = "1.7.2"; +const VERSION = "1.7.3"; var fs = require("fs"); var Logger = require("./logger.js"); diff --git a/user.js b/user.js index 3c4c8364..571f8f13 100644 --- a/user.js +++ b/user.js @@ -24,7 +24,6 @@ var User = function(socket, ip) { this.loggedIn = false; this.rank = Rank.Guest; this.channel = null; - this.playerReady = false; this.name = ""; this.meta = { afk: false @@ -155,7 +154,6 @@ User.prototype.initCallbacks = function() { if(this.channel != null) { this.channel.sendMediaUpdate(this); } - this.playerReady = true; }.bind(this)); this.socket.on("requestPlaylist", function() { diff --git a/www/assets/js/client.js b/www/assets/js/client.js index 2b94068a..986946f4 100644 --- a/www/assets/js/client.js +++ b/www/assets/js/client.js @@ -628,7 +628,7 @@ function synchtubeLayout() { } function onYouTubeIframeAPIReady() { - if(!PLAYER) + if(PLAYER.type == "null") PLAYER = new Media({id: "", type: "yt"}); if(USEROPTS.layout == "fluid") { fluidLayout(); diff --git a/www/assets/js/media.js b/www/assets/js/media.js index 1474b999..d95e3899 100644 --- a/www/assets/js/media.js +++ b/www/assets/js/media.js @@ -51,6 +51,7 @@ Media.prototype.nullPlayer = function() { Media.prototype.initYouTube = function() { this.removeOld(); + console.log("init YouTube"); this.player = new YT.Player("ytapiplayer", { height: VHEIGHT, width: VWIDTH, @@ -60,7 +61,7 @@ Media.prototype.initYouTube = function() { "controls": 1, }, events: { - onPlayerReady: function() { + onReady: function() { socket.emit("playerReady"); }, onStateChange: function(ev) {