Page 1 of 1

YouTube Video Link/Movies

Posted: 2021-01-04 14:52
by ronwill
Hi All,

Anyone noticed any change to displaying Youtube video link recently?

I've just noticed I get an error message when putting in any Youtube link and also all my older projects that used to display videos from YouTube now no longer do so.

Could it be related to PHP version on my server? That's the only change that I think I've made recently - my provided recommended updating to lowest supported version of 7.3

Cheers, Ron

Re: YouTube Video Link/Movies

Posted: 2021-01-04 22:43
by ronwill
Ok found one issue:

To enable display of video in detailed view:

File: IncCommon.php

The default incCommon.php file needs to be revised to show https instead of http under $providers = [
'youtube' => array('oembed' => 'https://www.youtube.com/oembed?'),
'googlemap' => array('oembed' => '', 'regex' => '/^https.*\.google\..*maps/i')
];

Code: Select all

	#########################################################

	function get_embed($provider, $url, $max_width = '', $max_height = '', $retrieve = 'html') {
		global $Translation;
		if(!$url) return '';

		$providers = [
			'youtube' => array('oembed' => 'https://www.youtube.com/oembed?'),
			'googlemap' => array('oembed' => '', 'regex' => '/^https.*\.google\..*maps/i')
		];
What still does not work is no thumbnail is displayed in standard table view (nothing/blank currently shows where a thumbnail used to be displayed).
- Anyone know how/where this can be fixed?

Ron

Re: YouTube Video Link/Movies

Posted: 2021-01-13 16:50
by ronwill
I still can't get YouTube thumbnails to display in table view!

Any solutions?

Re: YouTube Video Link/Movies

Posted: 2021-01-13 22:35
by pbottcher
Hi Ron,

you can edit the

datalist.php !!! Will be overwritten


Search for : %%YOUTUBETHUMB($fieldTVCaption)%%

and change

if(strpos($rowTemp, "<%%YOUTUBETHUMB($fieldTVCaption)%%>") !== false) $rowTemp = str_replace("<%%YOUTUBETHUMB($fieldTVCaption)%%>", thisOr(get_embed('youtube', $fd, '', '', 'thumbnail_url'), 'blank.gif'), $rowTemp);

to

if(strpos($rowTemp, "<%%YOUTUBETHUMB($fieldTVCaption)%%>") !== false) $rowTemp = str_replace("<%%YOUTUBETHUMB($fieldTVCaption)%%>", thisOr(get_embed('youtube', $fd, '50', '50', 'thumbnail_url'), 'blank.gif'), $rowTemp);

If you have a bigger thumbnail size, adjust the 50 to you needs.

Hope that helps.

Re: YouTube Video Link/Movies

Posted: 2021-01-14 00:15
by ronwill
Perfect! Thank you very much for providing the solution, really appreciated.

Works just right, no problem on datalist.php for me in this case as its a file I modify on each upload anyway, so your mod is now part of my standard edits.
Cheers, Ron