Skip to content

Commit a313bd8

Browse files
authored
Merge pull request #217 from ZoomZhao/develop
Fix black screen before play btn clicked
2 parents 53329f7 + 195e74a commit a313bd8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/SourceNodes/medianode.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ class MediaNode extends SourceNode {
9494
this._element.setAttribute("crossorigin", "anonymous");
9595
this._element.setAttribute("webkit-playsinline", "");
9696
this._element.setAttribute("playsinline", "");
97+
// This seems necessary to allow using video as a texture. See:
98+
// https://bugs.chromium.org/p/chromium/issues/detail?id=898550
99+
// https://github.com/pixijs/pixi.js/issues/5996
100+
this._element.preload = "auto";
97101
this._playbackRateUpdated = true;
98102
}
99103
this._element.volume = this._attributes.volume;

src/videoelementcacheitem.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ class VideoElementCacheItem {
1919
videoElement.setAttribute("crossorigin", "anonymous");
2020
videoElement.setAttribute("webkit-playsinline", "");
2121
videoElement.setAttribute("playsinline", "");
22+
// This seems necessary to allow using video as a texture. See:
23+
// https://bugs.chromium.org/p/chromium/issues/detail?id=898550
24+
// https://github.com/pixijs/pixi.js/issues/5996
25+
videoElement.preload = "auto";
2226
return videoElement;
2327
}
2428

0 commit comments

Comments
 (0)