# Video helper video()

**URL:** <https://forum.getkirby.com/t/video-helper-video/12731>\
**Category:** Questions\
**Tags:** v3\
**Created:** [February 6, 2019, 4:51pm UTC](https://forum.getkirby.com/t/video-helper-video/12731 "2019-02-06T16:51:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![H-i](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/h-i/32/4990_2.png) [@H-i](https://forum.getkirby.com/u/H-i)\
**Post date:** [February 6, 2019, 4:51pm UTC](https://forum.getkirby.com/t/video-helper-video/12731/1 "2019-02-06T16:51:21Z")

</div>

How am I supposed to get **OPTIONS** to work ?  
The video function loads the video(iframe), but no options are added to the url .  
The expected options added to the url for vimeo is this ‘(&title=0&byline=0&portrait=0)’

```auto
$video = video(
  $video,
  [
    'title' => false,
    'byline' => false,
    'portrait' => false
   ]
);

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 6, 2019, 6:46pm UTC](https://forum.getkirby.com/t/video-helper-video/12731/2 "2019-02-06T18:46:07Z")

</div>

> [@Youtube change from K2](https://forum.getkirby.com/t/youtube-change-from-k2/12482/10):
>
> I’m still not there, but for parameters that should be added to the URL, you can set them like this: 'kirbytext' =\> ['video' =\> ['options' =\> [ 'youtube' =\> [ 'autoplay' =\> true, 'controls' =\> 0, 'modestbranding' =\> 1, 'showinfo' =\> 0] ] ] ] Which then results in an iframe with a src url…

---

<div class="post-metadata">

**Author:** ![H-i](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/h-i/32/4990_2.png) [@H-i](https://forum.getkirby.com/u/H-i)\
**Post date:** [February 6, 2019, 8:49pm UTC](https://forum.getkirby.com/t/video-helper-video/12731/3 "2019-02-06T20:49:38Z")

</div>

Thank you darling ! It works like a charm…

```auto
$video = video(
         $url,
         $options = [
            'vimeo' => [
               'title' => false,
               'byline' => false,
               'portrait' => false,
               'muted' => true,
               'autoplay' => true,
               'loop' => true,
               'background' => false
            ],
            'youtube' => [
               'whatever' => true
            ]
         ]
      );

```

---

<div class="post-metadata">

**Author:** ![H-i](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/h-i/32/4990_2.png) [@H-i](https://forum.getkirby.com/u/H-i)\
**Post date:** [February 7, 2019, 8:07am UTC](https://forum.getkirby.com/t/video-helper-video/12731/4 "2019-02-07T08:07:40Z")

</div>

Entering wrong video url results in:  
`throw new Exception('Unexpected video type');`  
and craches site… and turning of debug mode gives this:

```auto
This page is currently offline due to an unexpected error. 
We are very sorry for the inconvenience and 
will fix it as soon as possible.

```

The video function should not crash the entire site right ? It should check and return false if invalid url is given… ?

kirby/src/Toolkit/Html.php

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 7, 2019, 8:47am UTC](https://forum.getkirby.com/t/video-helper-video/12731/5 "2019-02-07T08:47:47Z")

</div>

I don’t know if this is by design for debugging purposes or not. You could wrap using the function within a try-catch block to react on the exception yourself. And create an issue on GitHub.
