Skip to content

Commit

Permalink
fix: Do not autoplay if autoplay is not set (#8024)
Browse files Browse the repository at this point in the history
b2673fd (#7412) introduced a call to video.play() in a function that
says "Set start time of load if autoplay is enabled", but the function
did not actually check the autoplay attribute. This fixes the oversight.

Fixes #8022
  • Loading branch information
joeyparrish authored Feb 6, 2025
1 parent 24283e6 commit 0efdd2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/cmcd_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ shaka.util.CmcdManager = class {
* @param {number} startTimeOfLoad
*/
setStartTimeOfLoad(startTimeOfLoad) {
if (this.video_) {
if (this.video_ && this.video_.autoplay) {
const playResult = this.video_.play();
if (playResult) {
playResult.then(() => {
Expand Down

0 comments on commit 0efdd2b

Please sign in to comment.