Comments (4)
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.
.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.
Has anyone gotten this to successfully work?
from vue-youtube.
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)
- Not compatible with Vue 3 RC HOT 8
- event methods suddenly stopped working HOT 3
- Hide related videos HOT 1
- Modestbranding is not working
- If video is unavailable trigger the error function
- youtube 401 code error
- Add a prop for disabling controls on iframe HOT 1
- Missing @types/vue-youtube
- Youtube Api Key
- is there any way to remove ytp-pause-overlay ? HOT 1
- Add onApiChange event
- how to change height HOT 1
- Doesnt work with Vue 3.0 HOT 8
- Incorrect duration returned
- Trying to install it, I get the error: ERESOLVE unable to resolve dependency tree HOT 1
- Loading mixed (insecure) display content
- How to use YouTube video as the background?
- Missed Opportunity
- Failed to construct 'PresentationRequest': The document is sandboxed and lacks the 'allow-presentation' flag. HOT 3
- iframe is unable to load video
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-youtube.