Skip to content

Commit

Permalink
Mute video source element
Browse files Browse the repository at this point in the history
Fixes autoplay in Chrome and Safari.
  • Loading branch information
jfirebaugh committed Jun 14, 2018
1 parent 7d079a7 commit d3f8ffc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/util/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export const getImage = function(requestParameters: RequestParameters, callback:

export const getVideo = function(urls: Array<string>, callback: Callback<HTMLVideoElement>) {
const video: HTMLVideoElement = window.document.createElement('video');
video.muted = true;
video.onloadstart = function() {
callback(null, video);
};
Expand Down

0 comments on commit d3f8ffc

Please sign in to comment.