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

Negative duration / negative seeking #1174

Open
mcosti opened this issue Jan 22, 2024 · 3 comments
Open

Negative duration / negative seeking #1174

mcosti opened this issue Jan 22, 2024 · 3 comments
Assignees
Labels
1 backlog enhancement New feature or request

Comments

@mcosti
Copy link

mcosti commented Jan 22, 2024

Is your feature request related to a problem? Please describe.
It's not a problem with the package, more of a request for help.

Describe the solution you'd like
I am currently building a video editor where you can add an audio track with a certain offset. It can be a positive or negative offset vs the video itself. For the case of a positive offset, it's pretty easy.

Considering an offset of 30s, if I want to seek both video and audio to 10s, I just apply this formula:

videoController.seek(10);
audioController.seek(10 + 30);

But things become quite ugly and complicated when the offset is negative (the sound is starting later than my video).

I was wondering if anyone came to a clean solution where you can control the audio player's internal offset.
For a positive offset, it would just seek to the time + offset.
For a negative offset, it would need to have some kind of "empty sound" padding.

Describe alternatives you've considered
Complicated controllers and streams to keep track of the video current seek to determine if the audio should start playing or not

Additional context
This offset should be programatically changeable on the spot, hence simply adding a "phyisical" padding to the audio on the init is not viable.

@mcosti mcosti added 1 backlog enhancement New feature or request labels Jan 22, 2024
@richanshah
Copy link

@mcosti any update on this?

@mcosti
Copy link
Author

mcosti commented Aug 6, 2024

I ended up using a ticker that checks if the audio should be playing or no.

Quite complex logic but it works.

Unfortunately I cannot really share the code as it's not properly isolated

@richanshah
Copy link

richanshah commented Aug 9, 2024

ok can u do changes in lib for the same?

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

No branches or pull requests

3 participants