avidofood / vue-responsive-video-background-player

Play your own videos in background responsively in different resolutions.
https://avidofood.github.io/vue-responsive-video-background-player/
MIT License
292 stars 36 forks source link

Add stop() method or get access to video object #30

Open ribagek opened 2 years ago

ribagek commented 2 years ago

Hello!

I need to have ability to stop and reset video to the start. That's why I need the following in VideoPlayer.vue:

stop() {
            if (this.$refs.video) {
                this.$refs.video.stop();
            }
        },

or to have more control there'll be great to have:

video() {
            return this.$refs.video;
        },

thanks!

pmochine commented 2 years ago

Hey :) You should have everything what you need here https://github.com/avidofood/vue-responsive-video-background-player#methods

vdomah commented 2 years ago

@pmochine may be I don't understand, but how can I rollback a video to the start? I tried all methods from your list.

pmochine commented 2 years ago

@vdomah the "reload" method for HTML5 video is missing

Have a look here, you should implement this here as well.

vdomah commented 2 years ago

The problem is your load() method has 1 second delay and I can't make it 0. For now I solved my problem by rerendering the vue component by manually changing the :key attr of the component.