Skip to content

[Windows] Started event does not trigger when playing a video again after playback had finished playing a first time #2211

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

Open
knmcn619 opened this issue Apr 22, 2025 · 3 comments
Assignees
Labels
enhancement New feature or request triage Needs triage Windows Windows platform

Comments

@knmcn619
Copy link

Unity version

2022.53f1

Unity editor platform

Windows

AVPro Video edition

Core

AVPro Video version

2.9.3

Device hardware

11th Gen Intel Core i9 3.5GHz, 32GB RAM, NVIDIA GeForce RTX 3070

Which Windows version are you using?

Windows 10 Home (Version 10.0.19045 Build 19045)

Graphics API

D3D 11

Video API

Media Foundation

Audio output

System Direct

Any other Media Player component configuration required to reproduce the issue.

Media is set by reference to its location in the streaming assets folder. It is set to auto load, but not to auto play. Is is set to not loop.

Which output component(s) are you using?

Display uGUI

Any other component configuration required to reproduce the issue.

I have a script that is registering to the AVPro OnMediaPlayerEvent. I have a UI Button, that said script also has reference to, used to play and pause the video.

The issue

The first time a video is played after loading it triggers the "Started" media event, as would be expected. The video plays through its entirety and then fires off the "FinishedPlaying" event, again as would be expected. When the video is played again (currently using mediaPlayer.Play()) the "Started" event doesn't fire/get triggered but the video does in fact play.

Per the documentation, the "Started" event is triggered when playback starts. Is it not suppose to trigger every time the video playback starts? It seems like the started event should trigger every time, especially since the finished playing event fires again when the video plays to the end. And again, I'm not using looping video. Replay is triggered by clicking a button.

Both in my test environment, which I'll share via the email address, and in other projects I'm working on, I have actions I want to trigger every time a video is played or replayed.

Media information

I was testing with the AVPro Sample video: RenderHeads-1080p30-H264.

Log output

@knmcn619 knmcn619 added triage Needs triage Windows Windows platform labels Apr 22, 2025
@Chris-RH
Copy link
Contributor

I think the issue is that after it has played, it is paused, rather than being stopped. So therefore it is unpaused rather than starting again. I believe that if you called stop() at the end of the video, when you play it again, it should fire started.

@knmcn619
Copy link
Author

I tried adding a media player stop() call when the FinishedPlaying event occurs. If I click my UI play button after that (which calls media player play(), the Unpaused event occurs but the video remains at the end. If I call media player play() again after that, the video would begin playing from its beginning but the Started event does not occur. Instead, after adding more debug statements, I found that the StartedSeeking and FinishedSeeking events followed by an Unpaused event are what happens.

@Chris-RH Chris-RH added the enhancement New feature or request label Apr 24, 2025
@Chris-RH
Copy link
Contributor

We'll look into it and see what we can do with the events system to meet this requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Needs triage Windows Windows platform
Projects
None yet
Development

No branches or pull requests

2 participants