Using the video tag with YouTube URLs with a start time

Hello,

what is the proper way to embed a YouTube video with a start time in the URL as a GET parameter. Example:

https://youtu.be/<video id>?list=<list id>&t=<time in seconds>

When I do

(video: https://youtu.be/<video id>?list=<list id>&t=<time in seconds>)

it’s stripped down to an URL with no GET parameters. I found this issue some weeks ago and I don’t find the forum post or Github issue anymore where I did post about it . . . (maybe I didn’t ever post it?). I found this Embedding youtube videos with set value for "start at" but this might be outdated for Kirby 3 and I’m not sure if it’s a bug or a feature request.

Best Regards,

This has been fixed in 3.3.0: https://github.com/getkirby/kirby/issues/2118

So theoretically, it should also be possible to pass a starttime as an option parameter…

Let me test this and get back to you. Thank you @texnixe!

I’m not sure that the solution provided helps in my case. I do understand that the author of the Github issue had a problem with the youtube() function within his templates. In my case the YouTube video is not always a YouTube video (could be any supported source like vimeo) and the video is part of a textarea field so the relevant template part looks like this:

$page->text()->html()->kirbytext()

What I did expect was either to use the video tag with an URL with the proper GET parameter and it doesn’t get stripped or being able to provide the start time as an optional parameter to the video tag. This seems not to be supported so I have to write a plugin to extend the video tag functionality or use a hook to parse the Kirby 3 textfield for the video part, right? Adding a video field in my blueprint won’t work due to a video being optional and the video position within the text has to be flexible.

Thank you for your support!

Oh, right, the tag doesn’t support such options. Yes, than you either have to extend the tag or use a field for videos.

I don’t think that’s a reason not to include a video field, it doesn’t have to be a required field. But then again, if the video is supposed to be inside the text field, then this solution is probably not ideal.

I opened an enhancement request here:

I think that should actually go into the ideas repo, I’ll move it there.

1 Like