Giter VIP home page Giter VIP logo

Comments (4)

TitanFighter avatar TitanFighter commented on August 19, 2024

You can try to use the code below:

computed: {
    ....

    player () {
      return this.$refs.youtube.player
    },

    ....
},

methods: {
    ... 

    youtubeSeekTo () {
      this.player.seekTo(10)
    },

    ...
}

EDIT
It seems you need start parameter: https://developers.google.com/youtube/player_parameters#start

from vue-youtube.

jeff-hykin avatar jeff-hykin commented on August 19, 2024

.seekTo() isn't quite the same because instead of showing the thumbnail, the youtube player looks like it's stuck in an infinite loading loop until the video is played.

I have the same issue but with the start parameter too.

If I set autoplay=1, and start then it does start at the start time, but its stays paused and shows the loading spinner indefinitely. So that doesn't make much sense but its there.

from vue-youtube.

morsecodemedia avatar morsecodemedia commented on August 19, 2024

Has anyone gotten this to successfully work?

from vue-youtube.

jeff-hykin avatar jeff-hykin commented on August 19, 2024

Yes, but the workaround was terrible.

Took me a month to make a huge bulky wrapper around the system. The initial hack should be play, pause, then seek. But that's actually way way harder than it sounds because if you do .play() , .pause() then it's too fast and they cancel out and just stay paused. So you have to add a timed delay between the play and the pause, and if your user tries to click play/pause during your timed delay, everything gets wrecked. My workaround went all over the place including an invisible element infront of the player to prevent/catch clicking, and a system to shift focus away from the iframe to catch keystrokes.

To be fair this isn't a Vue YouTube problem. It's a embedded YouTube problem.

from vue-youtube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.