Skip to content

Commit

Permalink
still testing ios mobile behavior of video element
Browse files Browse the repository at this point in the history
  • Loading branch information
stamat committed Oct 26, 2023
1 parent c8c1410 commit 66f7983
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions jquery.youtube-background.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jquery.youtube-background.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jquery.youtube-background.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions src/lib/video-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ VideoBackground.prototype.seekTo = function (seconds) {

VideoBackground.prototype.injectPlayer = function () {
this.player = document.createElement('video');
this.player.muted = this.params.muted;
this.player.autoplay = this.params.autoplay && (this.params['always-play'] || this.isIntersecting);
this.player.loop = this.params.loop;
this.player.playsinline = true;
this.player.toggleAttribute('playsinline', true);
this.player.toggleAttribute('loop', this.params.loop);
this.player.toggleAttribute('autoplay', this.params.autoplay && (this.params['always-play'] || this.isIntersecting));
this.player.toggleAttribute('muted', this.params.muted);

if (this.params.volume !== 1 && !this.params.muted) this.setVolume(this.params.volume);

this.player.setAttribute('id', this.uid)
Expand Down

0 comments on commit 66f7983

Please sign in to comment.