Skip to content

Commit dcc7997

Browse files
committed
Fire load event when a browser intentionally suspends
1 parent 020c425 commit dcc7997

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

PxLoaderVideo.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ function PxLoaderVideo(url, tags, priority) {
5252
self.bind(self.readyEventName, onReadyStateChange);
5353
self.bind('error', onError);
5454

55+
// sometimes the browser will intentionally stop downloading
56+
// the video. In that case we'll consider the video loaded
57+
self.bind('suspend', onLoad);
58+
5559
self.vid.src = url;
5660
self.vid.load();
5761
};

0 commit comments

Comments
 (0)