Skip to content

Commit c0f60d1

Browse files
Merge pull request #224 from sandeep-vedam/fix/VideoTectureIssue
Fix/video texture issue
2 parents 2dc090b + 1ebbc6d commit c0f60d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/VideoPlayer/VideoTexture.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,21 @@ export default class VideoTexture extends Lightning.Component {
7474

7575
start() {
7676
const stage = this.stage
77+
this._lastTime = 0
7778
if (!this._updateVideoTexture) {
7879
this._updateVideoTexture = () => {
7980
if (this.videoTexture.options.source && this.videoEl.videoWidth && this.active) {
8081
const gl = stage.gl
8182

8283
const currentTime = new Date().getTime()
84+
const getVideoPlaybackQuality = this.videoEl.getVideoPlaybackQuality()
8385

8486
// When BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS is not set in WPE, webkitDecodedFrameCount will not be available.
8587
// We'll fallback to fixed 30fps in this case.
86-
const frameCount = this.videoEl.webkitDecodedFrameCount
88+
// As 'webkitDecodedFrameCount' is about to deprecate, check for the 'totalVideoFrames'
89+
const frameCount = getVideoPlaybackQuality
90+
? getVideoPlaybackQuality.totalVideoFrames
91+
: this.videoEl.webkitDecodedFrameCount
8792

8893
const mustUpdate = frameCount
8994
? this._lastFrame !== frameCount

0 commit comments

Comments
 (0)