HI,
Following the Kirby Kosmos recommendation, I tried to use the Plyr Kirbytag but unfortunately it is not working with self hosted video so far.
I followed the installation guide and used the following tag in the text article :
(plyr: video mp4: Gobe_Girl.mp4 poster: gonegirl.jpg)
The player is displayed but not playing the video file (which is directly in the current article folder.
Noted that when I used plyr player directly in the template, it works well.
I suspect a path issue configuration to find the video file, but I don’t know how to solve it.
thank you for the support
Hi there,
Some standard questions when debugging front-end code, stuff like content and display and images etc.:
- Have you checked the generated HTML code? What does it look like?
- Have you checked the HTTP requests made by the browser? (Using the browser’s developer tools, where there probably is a “Network” panel.) Is the browser requesting the video file? What does the server answer?
(Incidentally, I notice that your code extract says Gobe_Girl.mp4
, with “Gobe” and not “Gone”. Could that be the issue?)
Thank you for the answer and sorry to be so stupid !
You are incidentally right because it was just the typo in the name file (Gobe_Girl.mp4).
By the way, I still have a difficulty with the poster option.Not working within the kirbytag nor with the code in the template.
I created a video blueprint where the page has a thumb field with mage type for the image poster.
To implement it I have the following code but once again not displayed:
<video poster="<?php echo $page->thumb()->url ?>" controls>
video blueprint:
title: Video
pages: false
files: true
fields:
articleMeta:
label: Article Meta
type: headline
title:
label: Title
type: text
width: 4/5
thumb:
label: Poster
type: image
width: 1/5
description:
label: Description
type: textarea
icon: info-circle
Is the code correct or do I still miss something obvious ?
It should be
<?php echo $page->thumb()->toFile()->url() ?>
First of all, you should use the image method first, because your thumb field only returns a filename. Secondly, your url()
method is missing the parentheses.
BTW. it would be great if you could wrap your code blocks within three backticks on a separate line both before and after a code block. Makes your code much more readable. Thank you!
Edit: Have you enable debugging in your /site/config.php file: c::set('debug', true)
(or in your php.ini). That helps a lot when trying to find an error.
Thank you, it works now well.
I noted the instruction for wrapping code and config.php file advise.