Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.18k stars 518 forks source link

Change video captions #5479

Open thumaman opened 2 months ago

thumaman commented 2 months ago

Is there a way of changing captions of the video with custom buttons. What I mean by that is, I want to make my own button that displays available captions and by selecting them, they get updated in the video player.

I want this so that i can position and style my own buttons and menus with captions and make my application more customizable.

stsrki commented 2 months ago

This should be possible with the ControlsList parameter, which accepts an array of strings. The strings are, by default, the predefined names of the controls, but you should be able to define a custom name.

Here are some resources online that might help you to grasp it. Note they are for JS version but they should still apply

thumaman commented 2 months ago

So if I understand correctly I can define a custom control that can then be used to change the captions of the current video?

thumaman commented 2 months ago

Is it possible to do it all with C# and not use any JS?

stsrki commented 2 months ago

At the moment, it is not possible.

thumaman commented 2 months ago

Then I think it would be a useful feature to have since it is more independent and faster than JS, I would suggest the current player to have a currentTrack field which can then be used to change the video track of the player.

stsrki commented 2 months ago

Can you explain the proposed API and how it could be used?

thumaman commented 2 months ago

I would have the Video have an attribute called currentTrack which would be initially set to null or the Default value of Tracks array. Then a user could make a custom menu or use the one currently generated from Tracks which when clicking on a certain subtitle would change the visibility of the desired track from hidden/disabled to showing, thus displaying the track along with the video.

It could be used so the user could create a custom menu outside the video player with which he/she could manipulate the player and create a more customizable environment.

I hope I explained it well, if not let me know :)

image

thumaman commented 2 months ago

Will that functionality ever be supported in the upcoming weeks? :)

stsrki commented 2 months ago

Possibly yes. But it depends on the complexity. We also plan to migrate to the newer version of the video library so we need to be careful with adding too many features. In case they are not supported by this new library.

stsrki commented 2 months ago

Ps. #4914

thumaman commented 2 months ago

I understand. If possible I would also suggest that the Video has a Volume attribute, enabling a programmer to make a custom button/slider to manipulate with the volume of the player.

thumaman commented 1 month ago

Is there any more information on updating the video player/having customizable controls such as subtitles?

stsrki commented 1 month ago

Sorry, not yet planned. I could move it to the next milestone but there are still other work to do first.

In case you wish to help we're always open to contributions.

thumaman commented 1 month ago

That would be much appreciated.

Unfortunately I am very busy at the moment and probably will not be able to contibute to your project.

stsrki commented 6 days ago

https://github.com/Megabit/Blazorise/issues/4914#issuecomment-2208779460