Forum
Youtube field type
Hi there, experiencing the same error as in this (closed) thread: https://forum.grabaperch.com/forum/07-16-2016-youtube-addon-php-errors.
Notice: Undefined index: width in D:\Noizebox\Web\Repos\nb_main\site\perch\addons\fieldtypes\youtube\youtube.class.php on line 113
Notice: Undefined index: height in D:\Noizebox\Web\Repos\nb_main\site\perch\addons\fieldtypes\youtube\youtube.class.php on line 114
Notice: Undefined index: height in D:\Noizebox\Web\Repos\nb_main\site\perch\addons\fieldtypes\youtube\youtube.class.php on line 123
Notice: Undefined index: width in D:\Noizebox\Web\Repos\nb_main\site\perch\addons\fieldtypes\youtube\youtube.class.php on line 123
Warning: Division by zero in D:\Noizebox\Web\Repos\nb_main\site\perch\addons\fieldtypes\youtube\youtube.class.php on line 123
Even more irritating the preview renders correctly.
I have defined the youtube api key in config.php:
define('PERCH_YOUTUBE_API_KEY', 'XXX');
The template is:
<perch:content id="video" type="youtube" label="YouTube URL" />
<perch:content id="video" type="youtube" width="800" label="YouTube URL" output="embed" />
Does the video have a width and height?
Hi Drew, no need to waste your time anymore. I worked around it by loading the videos via javascript. But thanks anyway, Jens