diff --git a/src/browse/browse.js b/src/browse/browse.js index eca875e2..b00bd7a3 100644 --- a/src/browse/browse.js +++ b/src/browse/browse.js @@ -15,7 +15,7 @@ Answers properties: - showBrowse [get/set] - browseMode [get/set] - - recommendationMethod [get] + - recommendationMethod [get/set] - hasRecommendations [get] - playlistClickMode [get/set] - browse_video_id [set] @@ -168,6 +168,12 @@ Player.provide('browse', $this.showBrowse = sb; $this.loadRecommendations(); }); + + Player.setter('recommendationMethod', function (rm) { + $this.recommendationMethod = rm; + $this.loadRecommendations(); + }); + var _browseTimeouts = []; var _prevShow = false; Player.setter('browseMode', function(bm){ diff --git a/src/design/design.js b/src/design/design.js index d1973e49..a017a6ff 100644 --- a/src/design/design.js +++ b/src/design/design.js @@ -220,6 +220,11 @@ Player.provide('design', Player.getter('showTray', function(){ return $this.showTray; }); + Player.setter('showTray', function (st) { + $this.showTray = st; + $this.render(); + Player.fire("player:settings"); + }); /* Allow modules to set "blocking" and "persisting" forcing classes on body. @@ -251,7 +256,11 @@ Player.provide('design', Player.getter('accentColor', function(){ return $this.scrubberColor; }); - + + Player.setter('accentColor', function (sc) { + $this.scrubberColor = sc; + $this.render(); + }); /* === END TRAY HANDLING === */ $this.hexToRGBA = function(hex, alpha){ diff --git a/src/info/info.js b/src/info/info.js index 5e78a32e..4aca0f1d 100644 --- a/src/info/info.js +++ b/src/info/info.js @@ -10,6 +10,7 @@ - player:infoengaged: Info pane was toggles somehow Answers properties: + - showDomain [get/set] - showDescriptions [get/set] - infoTimeout [get] */ @@ -23,8 +24,12 @@ Player.provide('info', var $this = this; $.extend($this, opts); - $this.onRender = function(){ - Player.set('infoShown', (!!$this.showDescriptions && Player.get("playflowPosition") <= 1)); + $this.onRender = function () { + Player.set( + 'infoShown', + (!!$this.showDescriptions || !!$this.showDomain) && + Player.get("playflowPosition") <= 1, + ); }; // Bind to events @@ -40,12 +45,31 @@ Player.provide('info', }); /* GETTERS */ - Player.getter('infoShown', function(){ - return $this.infoShown; + + Player.getter('showDomain', function () { + return $this.showDomain; + }); + + Player.getter('showDescriptions', function () { + return $this.showDescriptions; + }); + + Player.getter("infoShown", function () { + return $this.infoShown; }); - Player.getter('showDomain', function(){ return $this.showDomain; }); /* SETTERS */ + + Player.setter('showDomain', function (sd) { + $this.showDomain = sd; + $this.render($this.onRender); + }); + + Player.setter('showDescriptions', function (sd) { + $this.showDescriptions = sd; + $this.render($this.onRender); + }); + Player.setter('infoShown', function(is){ $this.infoShown = is; Player.set("forcer", {type: "block", element: "tray", from: "info", active: $this.infoShown}); diff --git a/src/info/info.liquid b/src/info/info.liquid index d9a8a379..65ee0c27 100644 --- a/src/info/info.liquid +++ b/src/info/info.liquid @@ -1,6 +1,6 @@
- {% if video_title != empty%}

{{video_title|truncatewords:15}}

{% endif %} + {% if video_title != empty and showDescriptions %}

{{video_title|truncatewords:15}}

{% endif %} {% if showDomain and source != "site" %} {% if video.published_p != 0 && video.published_p != "0" %} {{domain|escape}} @@ -10,3 +10,4 @@ {% endif %}
+ diff --git a/src/logo/logo.css b/src/logo/logo.css index d30d55c2..0bf9ee3f 100644 --- a/src/logo/logo.css +++ b/src/logo/logo.css @@ -8,11 +8,14 @@ left: auto; right: 20px; } + .logo img { display: none; width: auto; height: auto; } + + .size-tiny .logo { display:none !important; } diff --git a/src/logo/logo.js b/src/logo/logo.js index 30794c6b..6405c616 100644 --- a/src/logo/logo.js +++ b/src/logo/logo.js @@ -7,7 +7,7 @@ Answers properties: - showLogo [get/set] - - logoSource [get] + - logoSource [get/set] */ Player.provide('logo', @@ -61,6 +61,17 @@ Player.provide('logo', Player.getter('showLogo', function(){return $this.showLogo||false;}); Player.getter('logoSource', function(){return $this.logoSource||'';}); + /* SETTERS */ + Player.setter("showLogo", function (sl) { + $this.showLogo = sl; + $this.render(_onRender); + }); + + Player.setter('logoSource', function(ls) { + $this.logoSource = ls; + $this.render(_onRender); + }); + return $this; } ); diff --git a/src/share-button/share-button.js b/src/share-button/share-button.js index ae70ee54..caa45312 100644 --- a/src/share-button/share-button.js +++ b/src/share-button/share-button.js @@ -6,25 +6,40 @@ - player:sharing */ -Player.provide('share-button', +Player.provide( + 'share-button', {}, - function(Player,$,opts){ + function (Player, $, opts) { var $this = this; $.extend($this, opts); $this.render($this.toggleShareButton); - $this.toggleShareButton = function(){ - window.setTimeout(function(){ - $this.container.toggle(!!Player.get("socialSharing") && !(Player.get('unmuteButtonPosition')=='topRight' && Player.get('showMutedAutoPlayButton'))); + $this.toggleShareButton = function () { + window.setTimeout(function () { + $this.container.toggle( + !!Player.get("socialSharing") && + !( + Player.get("unmuteButtonPosition") == "topRight" && + Player.get("showMutedAutoPlayButton") + ), + ); }, 10); - }; - Player.bind('player:settings player:video:loaded player:subtitlechange', $this.toggleShareButton); + Player.bind( + "player:settings player:video:loaded player:subtitlechange", + $this.toggleShareButton, + ); - return $this; - } + Player.bind("player:sharing:buttonChange", function (e, ss) { + $this.container + .find(".share-button") + .css({ display: ss ? "block" : "none" }); + }); + }; + return $this; + }, ); /* Translations for this module */ diff --git a/src/sharing/sharing.js b/src/sharing/sharing.js index a18ef584..ce991afd 100644 --- a/src/sharing/sharing.js +++ b/src/sharing/sharing.js @@ -11,10 +11,12 @@ - player:sharing: Whenever the sharing options are updated - player:sharing:shareengaged: Fires when sharing options are engaged (used by analytics) - player:sharing:embedengaged: Fires when embed is engaged (used by analytics) + - player:sharing:buttonChange: Fires when button should appear/disappear from the player Answers properties: - - socialSharing [get]: Is social sharing even supported by the video site? And is is enabled in settings? - - showSharing [get/set]: Show and hide the share pane. + - socialSharing [get/set] + - showSharing [get/set] + - showDownload [get/set] - rssLink [get] - podcastLink [get] - embedCode [get] @@ -185,6 +187,22 @@ Player.provide('sharing', } }); + Player.setter('showDownload', function (sd) { + $this.showDownload = sd; + Player.fire("player:module:overlayactivated", { + name: "download", + prevented: true,}).prevented; + $this.render(); + }); + + Player.setter("socialSharing", function (ss) { + $this.socialSharing = ss; + Player.fire("player:sharing:buttonChange", ss); + $this.render(); + }); + + + Player.bind("player:module:overlayactivated", function(e, info){ if(info.name != "sharing"){ Player.set("showSharing", false); diff --git a/src/subtitles/subtitles.js b/src/subtitles/subtitles.js index 17e7751d..a006ef6c 100644 --- a/src/subtitles/subtitles.js +++ b/src/subtitles/subtitles.js @@ -17,6 +17,7 @@ - hasSubtitles [get] - subtitleText [get/set] - subtitles [get/set] + - subtitlesDesign [get/set] - locales [get/set] - localesArray [get] - subtitleLocale [get/set] @@ -66,6 +67,7 @@ Player.provide('subtitles', Player.getter('enableSubtitles', function () { return $this.enableSubtitles; }); Player.getter('hasSubtitles', function () { return $this.hasSubtitles; }); Player.getter('subtitleText', function () { return $this.subtitleText; }); + Player.getter("subtitlesDesign", function () { return $this.subtitlesDesign; }); Player.getter('subtitles', function () { return $this.subtitles; }); Player.getter('locales', function () { return $this.locales; }); Player.getter('localesArray', function () { @@ -142,6 +144,15 @@ Player.provide('subtitles', Player.fire('player:subtitlechange'); $this.possiblyRender(); }); + + Player.setter('subtitlesDesign', function (sd) { + $this.subtitlesDesign = sd; + $this.container.removeClass("design-bars").removeClass("design-outline"); + $this.container.addClass("design-" + $this.subtitlesDesign || "bars"); + $this.render(); + Player.fire("player:subtitlechange"); + }); + Player.setter('audioDescriptionLocale', function (adl) { if (!$this.supportsAudioDescriptions) { $this.audioDescriptionLocale = '';