Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for start time for YouTube videos #45

Closed
bfintal opened this issue Jul 2, 2020 · 1 comment
Closed

Add support for start time for YouTube videos #45

bfintal opened this issue Jul 2, 2020 · 1 comment

Comments

@bfintal
Copy link
Contributor

bfintal commented Jul 2, 2020

in YouTube videos, you can specify the start time with a t=<time> param, e.g. t=60. It would be great if this can be supported

@henrygd
Copy link
Owner

henrygd commented Jul 2, 2020

You should be able to use the iframeSrc option to accomplish this. Here's a wrapper function that should let you add any parameters you want:

const BigPictureExtraParams = ({ el, ytSrc, params }) =>
	BigPicture({
		el,
		iframeSrc: `https://www.youtube.com/embed/${ytSrc}?rel=0&playsinline=1&autoplay=1&${params}`,
	})

// start the video at 25 seconds
BigPictureExtraParams({
	el: e.target,
	ytSrc: 'Crzwq4CjhvA',
	params: 'start=25',
})

@henrygd henrygd closed this as completed Jul 9, 2020
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

No branches or pull requests

2 participants