Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The play() request was interrupted by a call to pause() #90

Open
tjebbemarchand opened this issue Aug 24, 2023 · 3 comments
Open

The play() request was interrupted by a call to pause() #90

tjebbemarchand opened this issue Aug 24, 2023 · 3 comments

Comments

@tjebbemarchand
Copy link

Environments

  • Framework name: no framework, HTML, CSS, JS
  • Framework version: -
  • Scene.js Component version: 1.10.3
  • Testable Address(optional):

Description

I seem to have an issue with the latest version of SceneJS. I had to update SceneJS to the latest update in order to fix the cubic bezier easing option. I created an issue for it here: #88
But now I get the this error when loading in videos: The play() request was interrupted by a call to pause(). It doesn't happen with every video, but with some video's it does. If I downgrade the SceneJS version, it works and I don't get this error.

I use the following code to load in a video into Scene and play it

this.mediaScene = new MediaScene();

this.scene = new Scene({
	...this.animations,
	media: this.mediaScene
}, {
	selector: true,
	fillMode: "forwards",
	iterationCount: 1
});

this.mediaScene
	.addMedia('jger54t4', VIDEO_DOM_ELEMENT)
	.seek(0, 5)
	.setVolume(1)
	.setDelay(0)

Is it possible that there is an issue in the latest release that is causing this?

@tjebbemarchand
Copy link
Author

Hi @daybrush, I wanted to check in on the status of this issue. It's been a while, and I'm still experiencing the problem. If you need any additional information or assistance, please let me know. Thanks!

@mhaddon
Copy link

mhaddon commented Oct 21, 2023

I have also noticed that the latest version breaks the media library.
From what I can tell, it is immediately hitting the pause command just after playing it. It is getting confused that the current time is 0, and the duration of the media is 1.
Since 0 <= 0, from the pause logic, it always instantly pauses after starting a media.

From what I can see, you get one succesful call on the animate function, then, a ton of bogus calls with 0 current time and 1 duration.

@tjebbemarchand
Copy link
Author

Hi @daybrush, I did some investigation myself in the media scene package. And it seems that I found out what the issue is. The issue is in the @sceneje/media package in the Media.ts file. When I have multiple video's, it only plays the first video on screen. This is happening when I install @sceneje 1.10.0. @sceneje/media needs ^1.9.4. So it will also use @scenejs 1.10.0.

I have a quick fix for this. I changed the Media.ts file in the @sceneje/media package. I changed the following code on line 61:

const uuid = Number(Math.random()).toString(16).replace(".", "");
const mediaItem = this.newItem("media-" + uuid) as SceneItem;

And also on line 97:

const frameKey = Object.keys(e.frames).find(key) => key.startsWith("media"));
const frame = e.frames[frameKey];

I know that this is not the best solution haha. I hope that you can fix this issue in the next release. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants