mirror of https://github.com/calzoneman/sync.git
Reduce amount of data sent in media updates
This commit is contained in:
parent
69550c7a51
commit
ce99233596
9
media.js
9
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;
|
||||
|
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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");
|
||||
|
|
2
user.js
2
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() {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue