diff --git a/README.md b/README.md index 402ee4dd..204f2ca2 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ The following media sources are currently supported: - Soundcloud - Livestream.com - Twitch.tv +- Justin.tv - Ustream - RTMP livestreams diff --git a/channel.js b/channel.js index 1d0fd7d4..a0f177b8 100644 --- a/channel.js +++ b/channel.js @@ -694,6 +694,7 @@ function mediaUpdate(chan, id) { function isLive(type) { return type == "li" || type == "tw" + || type == "jt" || type == "rt" || type == "jw" || type == "us"; @@ -759,6 +760,12 @@ Channel.prototype.enqueue = function(data, user) { this.autoTemp(media, user); this.queueAdd(media, idx); break; + case "jt": + var media = new Media(data.id, "JustinTV - " + data.id, "--:--", "jt"); + media.queueby = user ? user.name : ""; + this.autoTemp(media, user); + this.queueAdd(media, idx); + break; case "us": InfoGetter.getUstream(data.id, function(id) { var media = new Media(id, "Ustream - " + data.id, "--:--", "us"); diff --git a/package.json b/package.json index 21db1b65..174c1d24 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.6", + "version": "1.7.7", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/server.js b/server.js index f660930f..0132f9b2 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.6"; +const VERSION = "1.7.7"; var fs = require("fs"); var Logger = require("./logger.js"); diff --git a/www/assets/js/functions.js b/www/assets/js/functions.js index 66bf0fe5..cd00bec6 100644 --- a/www/assets/js/functions.js +++ b/www/assets/js/functions.js @@ -500,6 +500,8 @@ function parseVideoURL(url){ } else if(url.indexOf("twitch.tv") != -1) return [parseTwitch(url), "tw"]; + else if(url.indexOf("justin.tv") != -1) + return [parseJustinTV(url), "jt"]; else if(url.indexOf("livestream.com") != -1) return [parseLivestream(url), "li"]; else if(url.indexOf("ustream.tv") != -1) @@ -544,6 +546,14 @@ function parseTwitch(url) { return null; } +function parseJustinTV(url) { + var m = url.match(/justin\.tv\/([a-zA-Z0-9]+)/); + if(m) { + return m[1]; + } + return null; +} + function parseLivestream(url) { var m = url.match(/livestream\.com\/([a-zA-Z0-9]+)/); if(m) { diff --git a/www/assets/js/media.js b/www/assets/js/media.js index c8a7f79e..585ba897 100644 --- a/www/assets/js/media.js +++ b/www/assets/js/media.js @@ -28,6 +28,9 @@ var Media = function(data) { case "tw": this.initTwitch(); break; + case "jt": + this.initJustinTV(); + break; case "rt": this.initRTMP(); break; @@ -322,6 +325,33 @@ Media.prototype.initTwitch = function() { this.seek = function() { } } +Media.prototype.initJustinTV = function() { + this.removeOld(); + var url = "http://www.justin.tv/widgets/live_embed_player.swf?channel="+this.id; + var params = { + allowFullScreen:"true", + allowScriptAccess:"always", + allowNetworking:"all", + movie:"http://www.justin.tv/widgets/live_embed_player.swf", + id: "live_embed_player_flash", + flashvars:"hostname=www.justin.tv&channel="+this.id+"&auto_play=true&start_volume=100" + }; + swfobject.embedSWF( url, "ytapiplayer", VWIDTH, VHEIGHT, "8", null, null, params, {} ); + + this.load = function(data) { + this.id = data.id; + this.initTwitch(); + } + + this.pause = function() { } + + this.play = function() { } + + this.getTime = function() { } + + this.seek = function() { } +} + Media.prototype.initRTMP = function() { this.removeOld(); var url = "http://fpdownload.adobe.com/strobe/FlashMediaPlayback_101.swf"; diff --git a/www/help.html b/www/help.html index bf0639e0..bd63b5be 100644 --- a/www/help.html +++ b/www/help.html @@ -140,6 +140,7 @@