Skip to content

Conversation

@rtritto
Copy link
Contributor

@rtritto rtritto commented Feb 18, 2025

Fix #151

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Note

To be tested and reviewed

@vercel
Copy link

vercel bot commented Feb 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
vlite Ready Ready Preview Nov 18, 2025 2:51pm

@rtritto
Copy link
Contributor Author

rtritto commented Feb 19, 2025

In my test, I have the videoReference (HTMLVideoElement).
Having an initial source, to change the source, I use:

videoReference.src = 'new-src.mp4'  // prefer src method over videoReference.setAttribute('src', 'new-src.mp4'); both trigger the DOM but src method also triggers a reload of the video content
videoReference.load()  // force video reload

The issue is that the player doesn't reload time (current time and time duration) and current progress bar.

2025-02-19.012843.mp4

There is any method of player that I should call?

@yoriiis
Copy link
Member

yoriiis commented Feb 20, 2025

Have you tested with audio and video HTML5?

@rtritto rtritto marked this pull request as draft February 22, 2025 00:27
@rtritto
Copy link
Contributor Author

rtritto commented Feb 22, 2025

Have you tested with audio and video HTML5?

Yes, the change works also with audio: the source is updated but the player doesn't reload time (current time and time duration) and current progress bar:

2025-02-22.233921.mp4

@yoriiis
Copy link
Member

yoriiis commented Feb 23, 2025

the source is updated but the player doesn't reload time (current time and time duration) and current progress bar:

The action to be taken after loading the new media is not so simple. The player needs to be “reset”

  • Time updates
  • Progress bar reset
  • Poster and big play button displayed
  • Plugin sync (for example subtitle needs to be hide/reload) etc.

@rtritto
Copy link
Contributor Author

rtritto commented Feb 23, 2025

The reset logic of the player should be added as event every time the source is changed by src attribute or by setSource method.
Do you agree?

@yoriiis
Copy link
Member

yoriiis commented Feb 28, 2025

The reset logic of the player should be added as event every time the source is changed by src attribute or by setSource method. Do you agree?

Yes. We can dispatch a new event sourcechange.

But this is only for user-specific purposes. The whole process of updating the player after changing the source should be dealt with here.

@vercel
Copy link

vercel bot commented Nov 18, 2025

@yoriiis is attempting to deploy a commit to the Vlitejs Team on Vercel.

A member of the Team first needs to authorize it.

@yoriiis
Copy link
Member

yoriiis commented Nov 18, 2025

The status checks are not updating, workflow have changed. Development has been moved to another PR (#186); I am copying you in.

@yoriiis yoriiis closed this Nov 18, 2025
@yoriiis yoriiis mentioned this pull request Nov 19, 2025
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

Successfully merging this pull request may close these issues.

Method to set source

2 participants