fanningert/kirbycms-extension-video

order of video files in kirbytag

Closed this issue · 2 comments

Hi @fanningert,
great plugin you have there, I've been playing with it for a bit and it's really convenient and reliable.

A small issue (that's actually more like a feature request) : there is no way to choose the order in which the files are embedded in the page from a kirbytag.

For example, when I mention both a .mp4 and a .webm, I get a

I see two possible solutions for this :

1. switch the inputting order at the end of the plugin. Currently, reading videoext.php, it's the following :

            // Sources
            $videoext->addSource ( $tag->attr ( 'ogg' ), 'video/ogg' );
            $videoext->addSource ( $tag->attr ( 'mp4' ), 'video/mp4' );
            $videoext->addSource ( $tag->attr ( 'webm' ), 'video/webm' );

Changing the last two works nicely without a hitch. Good.

2. A better solution would be to use the order the video files are mentioned in a kirbytag as the order in the

So if I write

(video: webm: video-1.webm mp4: video-1.mp4)
... I will get the webm first then the mp4. And if I write
(video: mp4: video-1.mp4 webm: video-1.webm)
... it will be the other way around.

Does that sound good to you? Is there any way to get the order of the tags in a kirbytag ?

For the first step I changed the order of the video files.

  1. webm
  2. mp4
  3. ogg

Thanks!