Skip to content
Merged
8 changes: 7 additions & 1 deletion src/browse/browse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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){
Expand Down
11 changes: 10 additions & 1 deletion src/design/design.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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){
Expand Down
34 changes: 29 additions & 5 deletions src/info/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- player:infoengaged: Info pane was toggles somehow

Answers properties:
- showDomain [get/set]
- showDescriptions [get/set]
- infoTimeout [get]
*/
Expand All @@ -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
Expand All @@ -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});
Expand Down
3 changes: 2 additions & 1 deletion src/info/info.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="info-overlay">
<div class="info-overlay-text">
{% if video_title != empty%}<h3 class="info-overlay-title">{{video_title|truncatewords:15}}</h3>{% endif %}
{% if video_title != empty and showDescriptions %}<h3 class="info-overlay-title">{{video_title|truncatewords:15}}</h3>{% endif %}
{% if showDomain and source != "site" %}
{% if video.published_p != 0 && video.published_p != "0" %}
<a href="{{url}}{{video_one}}" class="info-overlay-domain">{{domain|escape}}</a>
Expand All @@ -10,3 +10,4 @@
{% endif %}
</div>
</div>

3 changes: 3 additions & 0 deletions src/logo/logo.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
left: auto;
right: 20px;
}

.logo img {
display: none;
width: auto;
height: auto;
}


.size-tiny .logo {
display:none !important;
}
13 changes: 12 additions & 1 deletion src/logo/logo.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

Answers properties:
- showLogo [get/set]
- logoSource [get]
- logoSource [get/set]
*/

Player.provide('logo',
Expand Down Expand Up @@ -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;
}
);
Expand Down
33 changes: 24 additions & 9 deletions src/share-button/share-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
22 changes: 20 additions & 2 deletions src/sharing/sharing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions src/subtitles/subtitles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- hasSubtitles [get]
- subtitleText [get/set]
- subtitles [get/set]
- subtitlesDesign [get/set]
- locales [get/set]
- localesArray [get]
- subtitleLocale [get/set]
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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 = '';
Expand Down