From 80c18caa2884c107faad6fe1828d06c126951200 Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 11:49:29 +0100 Subject: [PATCH 01/13] Migration to Chromecasts Module --- src/app/lib/device/chromecast.js | 61 ++++++++++++++------------------ 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/src/app/lib/device/chromecast.js b/src/app/lib/device/chromecast.js index 0db7f10aa4..cb63255e73 100644 --- a/src/app/lib/device/chromecast.js +++ b/src/app/lib/device/chromecast.js @@ -1,7 +1,7 @@ (function (App) { 'use strict'; - var chromecast = require('chromecast-js'), + var chromecasts = require('chromecasts')(), collection = App.Device.Collection; var Chromecast = App.Device.Generic.extend({ @@ -16,8 +16,8 @@ initialize: function (attrs) { this.device = attrs.device; - this.attributes.id = this._makeID(this.device.config.name); - this.attributes.name = this.device.config.name; + this.attributes.id = this._makeID(this.device.name); + this.attributes.name = this.device.name; this.attributes.address = this.device.host; }, @@ -26,21 +26,16 @@ var subtitle = streamModel.get('subFile'); var cover = streamModel.get('cover'); var url = streamModel.get('src'); + var attr= streamModel.attributes; this.attributes.url = url; var media; if (subtitle) { media = { - url: url, - subtitles: [{ - url: 'http:' + url.split(':')[1] + ':9999/subtitle.vtt', - name: 'Subtitles', - language: 'en-US' - }], - cover: { - title: streamModel.get('title'), - url: streamModel.get('cover') - }, + title: streamModel.get('title'), + images: streamModel.get('cover'), + subtitles: ['http:' + url.split(':')[1] + ':9999/subtitle.vtt'], + subtitles_style: { backgroundColor: AdvSettings.get('subtitle_decoration') === 'Opaque Background' ? '#000000FF' : '#00000000', // color of background - see http://dev.w3.org/csswg/css-color/#hex-notation foregroundColor: AdvSettings.get('subtitle_color') + 'ff', // color of text - see http://dev.w3.org/csswg/css-color/#hex-notation @@ -57,25 +52,22 @@ }; } else { media = { - url: url, - cover: { - title: streamModel.get('title'), - url: streamModel.get('cover') - } + images: cover, + title: streamModel.get('title') }; } win.info('Chromecast: play ' + url + ' on \'' + this.get('name') + '\''); win.info('Chromecast: connecting to ' + this.device.host); - this.device.play(media, 0, function (err, status) { - if (err) { - win.error('chromecast.play error: ', err); - } else { - win.info('Playing ' + url + ' on ' + self.get('name')); - self.set('loadedMedia', status.media); - } - }); - this.device.on('status', function (status) { + self.device.play(url, media, function (err, status) { + if (err) { + win.error('chromecast.play error: ', err); + } else { + win.info('Playing ' + url + ' on ' + self.get('name')); + self.set('loadedMedia', status.media); + } + }); + this.device.on('status', function (status) { self._internalStatusUpdated(status); }); }, @@ -108,7 +100,7 @@ seekTo: function (newCurrentTime) { win.info('Chromecast: seek to %ss', newCurrentTime); - this.get('device').seekTo(newCurrentTime, function (err, status) { + this.get('device').seek(newCurrentTime, function (err, status) { if (err) { win.error('Chromecast.seekTo:Error', err); } @@ -135,8 +127,8 @@ updateStatus: function () { var self = this; - - this.get('device').getStatus(function (err, status) { + console.log(this.get('player')); + this.get('device').status(function (err, status) { if (err) { return win.info('Chromecast.updateStatus:Error', err); } @@ -150,16 +142,17 @@ } // If this is the active device, propagate the status event. if (collection.selected.id === this.id) { + console.log(status); App.vent.trigger('device:status', status); } } }); - var browser = new chromecast.Browser(); - browser.on('deviceOn', function (device) { - collection.add(new Chromecast({ - device: device +chromecasts.update(); +chromecasts.on('update', function (player) { + collection.add(new Chromecast({ + device: player })); }); From bdb0c026b2f7f4e9c0f4299fe559782e3fc048c1 Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 11:50:13 +0100 Subject: [PATCH 02/13] DLNA Improvement --- src/app/lib/device/dlna.js | 136 ++++++++++++++++++++++++++++--------- 1 file changed, 103 insertions(+), 33 deletions(-) diff --git a/src/app/lib/device/dlna.js b/src/app/lib/device/dlna.js index 809ea06a36..ac099b3c3e 100644 --- a/src/app/lib/device/dlna.js +++ b/src/app/lib/device/dlna.js @@ -1,9 +1,9 @@ (function (App) { 'use strict'; - var Browser = require('nodecast-js'); - var MediaRendererClient = require('upnp-mediarenderer-client'); + var dlnacasts = require('dlnacasts')(); + var xmlb = require('xmlbuilder'); var collection = App.Device.Collection; - var browser = new Browser(); + var makeID = function (baseID) { return 'dlna-' + baseID.replace('-', ''); @@ -17,74 +17,144 @@ makeID: makeID, initialize: function (attrs) { - this.device = attrs.device; - this.client = new MediaRendererClient(this.device.xml); - this.attributes.name = this.device.name; - this.attributes.address = this.device.host; + this.player = attrs.player; + this.attributes.name = this.player.name; + this.attributes.address = this.player.host; }, play: function (streamModel) { - var metadata = { - title: 'Butter DLNA', // upnp-mediarendered-client object - type: 'video', - url: streamModel.get('src'), - protocolInfo: 'http-get:*:video/mp4:*' - }; - - if (streamModel.get('subFile')) { // inject subtitles - metadata.subtitlesUrl = 'http:' + metadata.url.split(':')[1] + ':9999/video.srt'; + var url = streamModel.get('src'); + var url_video = url; + var url_subtitle = 'http:' + url.split(':')[1] + ':9999/video.srt'; + var metadata = null; + var subtitle = streamModel.get('subFile'); + if (subtitle) { + metadata = xmlb.create('DIDL-Lite', { + 'headless': true + }) + .att({ + 'xmlns': 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/', + 'xmlns:dc': 'http://purl.org/dc/elements/1.1/', + 'xmlns:upnp': 'urn:schemas-upnp-org:metadata-1-0/upnp/', + 'xmlns:dlna': 'urn:schemas-dlna-org:metadata-1-0/', + 'xmlns:sec': 'http://www.sec.co.kr/', + 'xmlns:xbmc': 'urn:schemas-xbmc-org:metadata-1-0/' + }) + .ele('item', { + 'id': '0', + 'parentID': '-1', + 'restricted': '1' + }) + .ele('dc:title', {}, streamModel.get('title')) + .insertAfter('res', { + 'protocolInfo': 'http-get:*:video/mp4:*', + 'xmlns:pv': 'http://www.pv.com/pvns/', + 'pv:subtitleFileUri': url_subtitle, + 'pv:subtitleFileType': 'srt' + }, url_video) + .insertAfter('res', { + 'protocolInfo': 'http-get:*:text/srt:' + }, url_subtitle) + .insertAfter('res', { + 'protocolInfo': 'http-get:*:smi/caption' + }, url_subtitle) + .insertAfter('sec:CaptionInfoEx', { + 'sec:type': 'srt' + }, url_subtitle) + .insertAfter('sec:CaptionInfo', { + 'sec:type': 'srt' + }, url_subtitle) + .insertAfter('upnp:class', {}, 'object.item.videoItem.movie') + .end({ + pretty: false + }); + } else { + metadata = xmlb.create('DIDL-Lite', { + 'headless': true + }) + .att({ + 'xmlns': 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/', + 'xmlns:dc': 'http://purl.org/dc/elements/1.1/', + 'xmlns:upnp': 'urn:schemas-upnp-org:metadata-1-0/upnp/', + 'xmlns:dlna': 'urn:schemas-dlna-org:metadata-1-0/', + 'xmlns:sec': 'http://www.sec.co.kr/', + 'xmlns:xbmc': 'urn:schemas-xbmc-org:metadata-1-0/' + }) + .ele('item', { + 'id': '0', + 'parentID': '-1', + 'restricted': '1' + }) + .ele('dc:title', {}, streamModel.get('title')) + .insertAfter('res', { + 'protocolInfo': 'http-get:*:video/mp4:*', + }, url_video) + .insertAfter('upnp:class', {}, 'object.item.videoItem.movie') + .end({ + pretty: false + }); } - - this.client.load(metadata.url, { + this.player.play(url_video, { metadata: metadata, autoplay: true, + }, function (err, result) { if (err) { throw err; } + }); + + }, stop: function () { - this.client.stop(); + this.player.stop(); }, pause: function () { - this.client.pause(); + this.player.pause(); }, forward: function () { - this.client.seek(30); + this.player.seek(30); }, backward: function () { - this.client.seek(-30); + this.player.seek(-30); }, + seek: function (seconds) { + win.info('DLNA: seek %s', seconds); + this.get('player').seek(seconds, function (err, status) { + if (err) { + win.error('DLNA.seek:Error', err); + } + }); + }, + + unpause: function () { - this.client.play(); + this.player.play(); } }); - browser.onDevice(function (device) { - device.onError(function (err) { - win.error('DNLA device error', err); - }); - + dlnacasts.on('update', function (player) { if (collection.where({ - id: device.host + id: player.host }).length === 0) { - win.info('Found DLNA Device: %s at %s', device.name, device.host); + win.info('Found DLNA Device: %s at %s', player.name, player.host); collection.add(new Dlna({ - id: device.host, - device: device + id: player.host, + player: player })); } }); win.info('Scanning: Local Network for DLNA devices'); - browser.start(); + dlnacasts.update(); + App.Device.Dlna = Dlna; })(window.App); From ecc047969626a3019d931ace0fd91a292a8725bf Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 11:53:22 +0100 Subject: [PATCH 03/13] New Deps/ Remove Old deps Add Chromecasts / Dlnacasts Remove Upnp-Mediarendrer / chromecast-js / nodecast-js --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b22d469332..331f39780f 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "adm-zip": "0.4.7", "airplay-js": "git+https://github.com/guerrerocarlos/node-airplay-js.git", "async": "1.5.x", - "chromecast-js": "git+https://github.com/captainyarr/chromecast-js.git", + "chromecasts": "git+https://github.com/mafintosh/chromecasts.git", + "dlnacasts": "^0.0.3" "gitlab": "1.4.1", "defer-request": "0.0.2", "i18n": "0.x.x", @@ -58,7 +59,6 @@ "node-captions": "0.4.6", "node-tvdb": "1.6.x", "node-webkit-fdialogs": "latest", - "nodecast-js": "^1.0.1", "opensubtitles-api": "^2.3.x", "os-name": "1.x.x", "peerflix": "^0.32.1", @@ -77,7 +77,6 @@ "trakt.tv": "1.x.x", "trakt.tv-ondeck": "0.x", "underscore": "1.x.x", - "upnp-mediarenderer-client": "1.x.x", "urijs": "1.x.x", "xmlbuilder": "4.1.0" }, From 078f4663cd378a88af73c70eff53ef9b81c6019f Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 11:53:45 +0100 Subject: [PATCH 04/13] Typo --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 331f39780f..f04f82d833 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "airplay-js": "git+https://github.com/guerrerocarlos/node-airplay-js.git", "async": "1.5.x", "chromecasts": "git+https://github.com/mafintosh/chromecasts.git", - "dlnacasts": "^0.0.3" + "dlnacasts": "^0.0.3", "gitlab": "1.4.1", "defer-request": "0.0.2", "i18n": "0.x.x", From f4eb37dd9e112fc2fbf31a433548a902ce9828e8 Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 11:56:18 +0100 Subject: [PATCH 05/13] Remote control for DLNA --- src/app/lib/views/player/loading.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/lib/views/player/loading.js b/src/app/lib/views/player/loading.js index 1f65c7a410..e2e99cebb6 100644 --- a/src/app/lib/views/player/loading.js +++ b/src/app/lib/views/player/loading.js @@ -104,7 +104,7 @@ if (state === 'playingExternally') { this.ui.stateTextDownload.hide(); this.ui.progressbar.hide(); - if (streamInfo.get('player') && streamInfo.get('player').get('type') === 'chromecast') { + if (streamInfo.get('player') && streamInfo.get('player').get('type') === 'chromecast' | streamInfo.get('player').get('type') === 'dlna') { this.ui.controls.css('visibility', 'visible'); this.ui.playingbarBox.css('visibility', 'visible'); this.ui.playingbar.css('width', '0%'); From 7229ca42151340565218d122fb3f43a51f3046c1 Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 14:24:13 +0100 Subject: [PATCH 06/13] Add Progress Functions on DLNA --- src/app/lib/device/dlna.js | 148 ++++++++++++++++++------------------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/src/app/lib/device/dlna.js b/src/app/lib/device/dlna.js index ac099b3c3e..3b1bf47c6d 100644 --- a/src/app/lib/device/dlna.js +++ b/src/app/lib/device/dlna.js @@ -24,89 +24,53 @@ play: function (streamModel) { var url = streamModel.get('src'); + var self = this; + var media; var url_video = url; var url_subtitle = 'http:' + url.split(':')[1] + ':9999/video.srt'; var metadata = null; var subtitle = streamModel.get('subFile'); if (subtitle) { - metadata = xmlb.create('DIDL-Lite', { - 'headless': true - }) - .att({ - 'xmlns': 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/', - 'xmlns:dc': 'http://purl.org/dc/elements/1.1/', - 'xmlns:upnp': 'urn:schemas-upnp-org:metadata-1-0/upnp/', - 'xmlns:dlna': 'urn:schemas-dlna-org:metadata-1-0/', - 'xmlns:sec': 'http://www.sec.co.kr/', - 'xmlns:xbmc': 'urn:schemas-xbmc-org:metadata-1-0/' - }) - .ele('item', { - 'id': '0', - 'parentID': '-1', - 'restricted': '1' - }) - .ele('dc:title', {}, streamModel.get('title')) - .insertAfter('res', { - 'protocolInfo': 'http-get:*:video/mp4:*', - 'xmlns:pv': 'http://www.pv.com/pvns/', - 'pv:subtitleFileUri': url_subtitle, - 'pv:subtitleFileType': 'srt' - }, url_video) - .insertAfter('res', { - 'protocolInfo': 'http-get:*:text/srt:' - }, url_subtitle) - .insertAfter('res', { - 'protocolInfo': 'http-get:*:smi/caption' - }, url_subtitle) - .insertAfter('sec:CaptionInfoEx', { - 'sec:type': 'srt' - }, url_subtitle) - .insertAfter('sec:CaptionInfo', { - 'sec:type': 'srt' - }, url_subtitle) - .insertAfter('upnp:class', {}, 'object.item.videoItem.movie') - .end({ - pretty: false - }); + media = { + title: streamModel.get('title'), + images: streamModel.get('cover'), + subtitles: ['http:' + url.split(':')[1] + ':9999/subtitle.vtt'], + + subtitles_style: { + backgroundColor: AdvSettings.get('subtitle_decoration') === 'Opaque Background' ? '#000000FF' : '#00000000', // color of background - see http://dev.w3.org/csswg/css-color/#hex-notation + foregroundColor: AdvSettings.get('subtitle_color') + 'ff', // color of text - see http://dev.w3.org/csswg/css-color/#hex-notation + edgeType: AdvSettings.get('subtitle_decoration') === 'Outline' ? 'OUTLINE' : 'NONE', // border of text - can be: "NONE", "OUTLINE", "DROP_SHADOW", "RAISED", "DEPRESSED" + edgeColor: '#000000FF', // color of border - see http://dev.w3.org/csswg/css-color/#hex-notation + fontScale: ((parseFloat(AdvSettings.get('subtitle_size')) / 28) * 1.3).toFixed(1), // size of the text - transforms into "font-size: " + (fontScale*100) +"%" + fontStyle: 'NORMAL', // can be: "NORMAL", "BOLD", "BOLD_ITALIC", "ITALIC", + fontFamily: 'Helvetica', + fontGenericFamily: 'SANS_SERIF', // can be: "SANS_SERIF", "MONOSPACED_SANS_SERIF", "SERIF", "MONOSPACED_SERIF", "CASUAL", "CURSIVE", "SMALL_CAPITALS", + windowColor: '#00000000', // see http://dev.w3.org/csswg/css-color/#hex-notation + windowRoundedCornerRadius: 0, // radius in px + windowType: 'NONE' // can be: "NONE", "NORMAL", "ROUNDED_CORNERS" + } + }; } else { - metadata = xmlb.create('DIDL-Lite', { - 'headless': true - }) - .att({ - 'xmlns': 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/', - 'xmlns:dc': 'http://purl.org/dc/elements/1.1/', - 'xmlns:upnp': 'urn:schemas-upnp-org:metadata-1-0/upnp/', - 'xmlns:dlna': 'urn:schemas-dlna-org:metadata-1-0/', - 'xmlns:sec': 'http://www.sec.co.kr/', - 'xmlns:xbmc': 'urn:schemas-xbmc-org:metadata-1-0/' - }) - .ele('item', { - 'id': '0', - 'parentID': '-1', - 'restricted': '1' - }) - .ele('dc:title', {}, streamModel.get('title')) - .insertAfter('res', { - 'protocolInfo': 'http-get:*:video/mp4:*', - }, url_video) - .insertAfter('upnp:class', {}, 'object.item.videoItem.movie') - .end({ - pretty: false - }); + media = { + images: cover, + title: streamModel.get('title') + }; } - this.player.play(url_video, { - metadata: metadata, - autoplay: true, - - }, function (err, result) { - if (err) { - throw err; - } - + win.info('DLNA: play ' + url + ' on \'' + this.get('name') + '\''); + win.info('DLNA: connecting to ' + this.player.host); + + self.player.play(url_video, media , function (err, status) { + if (err) { + win.error('DLNA.play error: ', err); + } else { + win.info('Playing ' + url + ' on ' + self.get('name')); + self.set('loadedMedia', status.media); + } }); - - - }, + this.player.on('status', function (status) { + self._internalStatusUpdated(status); + }); + }, stop: function () { this.player.stop(); @@ -132,10 +96,44 @@ } }); }, + seekTo: function (newCurrentTime) { + win.info('DLNA: seek to %ss', newCurrentTime); + this.get('player').seek(newCurrentTime, function (err, status) { + if (err) { + win.error('DLNA.seek:Error', err); + } + }); + }, + seekPercentage: function (percentage) { + console.log(this); + win.info('DLNA: seek percentage %s%', percentage.toFixed(2)); + var newCurrentTime = this.player._status.duration / 100 * percentage; + this.seekTo(newCurrentTime.toFixed()); + }, unpause: function () { this.player.play(); + }, + updateStatus: function () { + var self = this; + this.get('player').status(function (err, status) { + if (err) { + return win.info('DLNA.updateStatus:Error', err); + } + self._internalStatusUpdated(status); + }); + }, + + _internalStatusUpdated: function (status) { + if (status === undefined) { + status = this.player._status; + } + // If this is the active device, propagate the status event. + if (collection.selected.id === this.id) { + console.log(status); + App.vent.trigger('device:status', status); + } } }); From 411331ec60bd8766188ef94025640f973c47035f Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 14:24:54 +0100 Subject: [PATCH 07/13] Add Progress BAR on DLNA --- src/app/lib/views/player/loading.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/lib/views/player/loading.js b/src/app/lib/views/player/loading.js index e2e99cebb6..434ffd407b 100644 --- a/src/app/lib/views/player/loading.js +++ b/src/app/lib/views/player/loading.js @@ -152,12 +152,22 @@ }, onDeviceStatus: function (status) { - if (status.media !== undefined && status.media.duration !== undefined) { + var streamInfo = this.model.get('streamInfo'); + if (status.media !== undefined && status.media.duration !== undefined && streamInfo.get('player').get('type') === 'chromecast' ) + { + // Update playingbar width + var playedPercent = status.currentTime / status.media.duration * 100; + this.ui.playingbar.css('width', playedPercent.toFixed(1) + '%'); + win.debug('ExternalStream: %s: %ss / %ss (%s%)', status.playerState, + status.currentTime.toFixed(1), status.media.duration.toFixed(), playedPercent.toFixed(1)); + } + if (status.playerState !== undefined && status.duration !== undefined && streamInfo.get('player').get('type') === 'dlna') + { // Update playingbar width - var playedPercent = status.currentTime / status.media.duration * 100; + var playedPercent = status.currentTime / status.duration * 100; this.ui.playingbar.css('width', playedPercent.toFixed(1) + '%'); win.debug('ExternalStream: %s: %ss / %ss (%s%)', status.playerState, - status.currentTime.toFixed(1), status.media.duration.toFixed(), playedPercent.toFixed(1)); + status.currentTime.toFixed(1), status.duration.toFixed(), playedPercent.toFixed(1)); } if (!this.extPlayerStatusUpdater && status.playerState === 'PLAYING') { // First PLAYING state. Start requesting device status update every 5 sec From fdd331f88d82e1a217d12d393c019c6b7e8b2c96 Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 14:30:48 +0100 Subject: [PATCH 08/13] JSHINT Fix --- src/app/lib/views/player/loading.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/lib/views/player/loading.js b/src/app/lib/views/player/loading.js index 434ffd407b..dacd43a3d0 100644 --- a/src/app/lib/views/player/loading.js +++ b/src/app/lib/views/player/loading.js @@ -164,10 +164,10 @@ if (status.playerState !== undefined && status.duration !== undefined && streamInfo.get('player').get('type') === 'dlna') { // Update playingbar width - var playedPercent = status.currentTime / status.duration * 100; - this.ui.playingbar.css('width', playedPercent.toFixed(1) + '%'); + var playedPercent2 = status.currentTime / status.duration * 100; + this.ui.playingbar.css('width', playedPercent2.toFixed(1) + '%'); win.debug('ExternalStream: %s: %ss / %ss (%s%)', status.playerState, - status.currentTime.toFixed(1), status.duration.toFixed(), playedPercent.toFixed(1)); + status.currentTime.toFixed(1), status.duration.toFixed(), playedPercent2.toFixed(1)); } if (!this.extPlayerStatusUpdater && status.playerState === 'PLAYING') { // First PLAYING state. Start requesting device status update every 5 sec From 8ff1c6fbdc20606ea33c6df2d344c4b90ff25cb2 Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 14:31:45 +0100 Subject: [PATCH 09/13] Remove unused Parms --- src/app/lib/device/dlna.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/app/lib/device/dlna.js b/src/app/lib/device/dlna.js index 3b1bf47c6d..64bc265358 100644 --- a/src/app/lib/device/dlna.js +++ b/src/app/lib/device/dlna.js @@ -33,26 +33,10 @@ if (subtitle) { media = { title: streamModel.get('title'), - images: streamModel.get('cover'), subtitles: ['http:' + url.split(':')[1] + ':9999/subtitle.vtt'], - - subtitles_style: { - backgroundColor: AdvSettings.get('subtitle_decoration') === 'Opaque Background' ? '#000000FF' : '#00000000', // color of background - see http://dev.w3.org/csswg/css-color/#hex-notation - foregroundColor: AdvSettings.get('subtitle_color') + 'ff', // color of text - see http://dev.w3.org/csswg/css-color/#hex-notation - edgeType: AdvSettings.get('subtitle_decoration') === 'Outline' ? 'OUTLINE' : 'NONE', // border of text - can be: "NONE", "OUTLINE", "DROP_SHADOW", "RAISED", "DEPRESSED" - edgeColor: '#000000FF', // color of border - see http://dev.w3.org/csswg/css-color/#hex-notation - fontScale: ((parseFloat(AdvSettings.get('subtitle_size')) / 28) * 1.3).toFixed(1), // size of the text - transforms into "font-size: " + (fontScale*100) +"%" - fontStyle: 'NORMAL', // can be: "NORMAL", "BOLD", "BOLD_ITALIC", "ITALIC", - fontFamily: 'Helvetica', - fontGenericFamily: 'SANS_SERIF', // can be: "SANS_SERIF", "MONOSPACED_SANS_SERIF", "SERIF", "MONOSPACED_SERIF", "CASUAL", "CURSIVE", "SMALL_CAPITALS", - windowColor: '#00000000', // see http://dev.w3.org/csswg/css-color/#hex-notation - windowRoundedCornerRadius: 0, // radius in px - windowType: 'NONE' // can be: "NONE", "NORMAL", "ROUNDED_CORNERS" - } }; } else { media = { - images: cover, title: streamModel.get('title') }; } From 1b4c9836fec0162e4aabd668743d5f0e608de4df Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 14:33:21 +0100 Subject: [PATCH 10/13] Remove Debug Console.log --- src/app/lib/device/dlna.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/app/lib/device/dlna.js b/src/app/lib/device/dlna.js index 64bc265358..b42f4c66a3 100644 --- a/src/app/lib/device/dlna.js +++ b/src/app/lib/device/dlna.js @@ -90,7 +90,6 @@ }, seekPercentage: function (percentage) { - console.log(this); win.info('DLNA: seek percentage %s%', percentage.toFixed(2)); var newCurrentTime = this.player._status.duration / 100 * percentage; this.seekTo(newCurrentTime.toFixed()); @@ -115,7 +114,6 @@ } // If this is the active device, propagate the status event. if (collection.selected.id === this.id) { - console.log(status); App.vent.trigger('device:status', status); } } From 9f8bedf8b77d2dd083e6c1fca6beb82f5ad426ae Mon Sep 17 00:00:00 2001 From: team-pct Date: Tue, 19 Apr 2016 15:34:21 +0100 Subject: [PATCH 11/13] Remove Debug Fix indent --- src/app/lib/device/chromecast.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/app/lib/device/chromecast.js b/src/app/lib/device/chromecast.js index cb63255e73..5b59d1899f 100644 --- a/src/app/lib/device/chromecast.js +++ b/src/app/lib/device/chromecast.js @@ -58,18 +58,20 @@ } win.info('Chromecast: play ' + url + ' on \'' + this.get('name') + '\''); win.info('Chromecast: connecting to ' + this.device.host); - - self.device.play(url, media, function (err, status) { - if (err) { - win.error('chromecast.play error: ', err); - } else { + self.device.play(url, media, function (err, status) { + if (err) { + win.error('chromecast.play error: ', err); + + } else { win.info('Playing ' + url + ' on ' + self.get('name')); self.set('loadedMedia', status.media); } }); - this.device.on('status', function (status) { + this.device.on('status', function (status) { self._internalStatusUpdated(status); - }); + + }); + }, pause: function () { @@ -127,7 +129,7 @@ updateStatus: function () { var self = this; - console.log(this.get('player')); + this.get('device').status(function (err, status) { if (err) { return win.info('Chromecast.updateStatus:Error', err); @@ -142,15 +144,15 @@ } // If this is the active device, propagate the status event. if (collection.selected.id === this.id) { - console.log(status); + App.vent.trigger('device:status', status); } } }); -chromecasts.update(); -chromecasts.on('update', function (player) { + chromecasts.update(); + chromecasts.on('update', function (player) { collection.add(new Chromecast({ device: player })); From 6fd66dab6efdf5f944e3d599ae479e92e6558baa Mon Sep 17 00:00:00 2001 From: Brian Ardiles Date: Sun, 24 Apr 2016 00:11:51 -0300 Subject: [PATCH 12/13] Fix chromecast subtitle position --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f04f82d833..464a2e2ba1 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test": "gulp test" }, "engines": { - "npm": ">=3.0.0", + "npm": ">=3.0.0",n "node": ">=0.12.0" }, "window": { @@ -56,7 +56,7 @@ "moment": ">=2.11.2", "mv": "2.x.x", "nedb": "1.4.0", - "node-captions": "0.4.6", + "node-captions": "git+https://github.com/brai4u/node-captions.git", "node-tvdb": "1.6.x", "node-webkit-fdialogs": "latest", "opensubtitles-api": "^2.3.x", From f80e2d458029b0f9e22c6bad80b8e09b18110d93 Mon Sep 17 00:00:00 2001 From: Brian Ardiles Date: Sun, 24 Apr 2016 00:15:45 -0300 Subject: [PATCH 13/13] Now, fixed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 464a2e2ba1..18ecd50ee4 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test": "gulp test" }, "engines": { - "npm": ">=3.0.0",n + "npm": ">=3.0.0", "node": ">=0.12.0" }, "window": {