diff --git a/dist/videojs-chromecast.js b/dist/videojs-chromecast.js index f387b56..f2e288b 100644 --- a/dist/videojs-chromecast.js +++ b/dist/videojs-chromecast.js @@ -226,10 +226,16 @@ var ChromeCastButton = (function (_Button) { tracks.push(track); } mediaInfo.textTrackStyle = new chrome.cast.media.TextTrackStyle(); - mediaInfo.textTrackStyle.foregroundColor = '#FFFFFF'; - mediaInfo.textTrackStyle.backgroundColor = '#00000060'; - mediaInfo.textTrackStyle.edgeType = chrome.cast.media.TextTrackEdgeType.DROP_SHADOW; - mediaInfo.textTrackStyle.windowType = chrome.cast.media.TextTrackWindowType.ROUNDED_CORNERS; + + // Update the font to a more generic ux ( Used netflix as example ) + mediaInfo.textTrackStyle = new chrome.cast.media.TextTrackStyle(); + mediaInfo.textTrackStyle.fontFamily = 'Arial' + mediaInfo.textTrackStyle.foregroundColor = '#FFFFFF'; + mediaInfo.textTrackStyle.backgroundColor = '#00000000'; + mediaInfo.textTrackStyle.fontScale = '1.1' + mediaInfo.textTrackStyle.edgeColor = '#00000099' + mediaInfo.textTrackStyle.edgeType = chrome.cast.media.TextTrackEdgeType.DROP_SHADOW; + } // Load/Add audio tracks @@ -261,6 +267,15 @@ var ChromeCastButton = (function (_Button) { loadRequest.autoplay = true; loadRequest.currentTime = this.player_.currentTime(); + // Set active track by selected subtitle + var activeTrack = 0 + document.querySelectorAll('.vjs-menu-content > .vjs-captions-menu-item').forEach(function(el, i) { + if (el.classList.contains('vjs-selected')) { + activeTrack = (i + 1) + } + }) + loadRequest.activeTrackIds = [activeTrack]; + this.apiSession.loadMedia(loadRequest, this.onMediaDiscovered.bind(this), this.castError.bind(this)); this.apiSession.addUpdateListener(this.onSessionUpdate.bind(this)); } @@ -473,7 +488,7 @@ var Chromecast = (function (_Tech) { _createClass(Chromecast, [{ key: 'createEl', value: function createEl() { - var el = _videoJs2['default'].createEl('div', { + var el = _videoJs2['default'].dom.createEl('div', { id: this.options_.techId, className: 'vjs-tech vjs-tech-chromecast' }); @@ -1008,4 +1023,4 @@ exports['default'] = plugin; module.exports = exports['default']; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"./videojs-chromecast":3}]},{},[4])(4) -}); \ No newline at end of file +});