Skip to content

Commit

Permalink
Merge pull request #105 from cloudinary/CLD-13628-autoplay-floating
Browse files Browse the repository at this point in the history
CLD-13628 autoplay-on-scroll pauses floating players
  • Loading branch information
tsi authored Jul 7, 2019
2 parents 7e0d6bf + b970207 commit 82983d1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 50 deletions.
74 changes: 25 additions & 49 deletions docs/subtitles-and-captions.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,57 +22,33 @@

var cld = cloudinary.Cloudinary.new({ cloud_name: 'yaronr' });

/* var player = cld.videoPlayer('player', {
publicId: 'stubhub',
textTracks: {
captions: {
label: 'English captions',
language: 'en',
default: true,
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558965984/Meetup_english.vtt'
},
subtitles: [
{
label: 'German subtitles',
language: 'de',
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558966008/Meetup_german.vtt'
var player = cld.videoPlayer('player');

player.source(
'stubhub',
{
textTracks: {
captions: {
label: 'English captions',
language: 'en',
default: true,
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558965984/Meetup_english.vtt'
},
{
label: 'Russian subtitles',
language: 'ru',
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558966053/Meetup_russian.vtt'
}
]
subtitles: [
{
label: 'German subtitles',
language: 'de',
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558966008/Meetup_german.vtt'
},
{
label: 'Russian subtitles',
language: 'ru',
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558966053/Meetup_russian.vtt'
}
]
}
}
});*/

var player = cld.videoPlayer('player');

player.source(
'stubhub',
{
textTracks: {
captions: {
label: 'English captions',
language: 'en',
default: true,
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558965984/Meetup_english.vtt'
},
subtitles: [
{
label: 'German subtitles',
language: 'de',
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558966008/Meetup_german.vtt'
},
{
label: 'Russian subtitles',
language: 'ru',
url: 'https://res.cloudinary.com/yaronr/raw/upload/v1558966053/Meetup_russian.vtt'
}
]
}
}
);
);

}, false);
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/autoplay-on-scroll/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AutoplayOnScrollPlugin {
if (this.player.paused()) {
play();
}
} else if (!this.player.paused()) {
} else if (!this.player.paused() && !this.player.activePlugins_.floatingPlayer) {
pause();
}
};
Expand Down

0 comments on commit 82983d1

Please sign in to comment.