YouTube Video Link/Movies

Please report bugs and any annoyances here. Kindly include all possible details: steps to reproduce, expected result, actual result, screenshots, ... etc.
Post Reply
User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

YouTube Video Link/Movies

Post by ronwill » 2021-01-04 14:52

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
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: YouTube Video Link/Movies

Post by ronwill » 2021-01-04 22:43

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
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: YouTube Video Link/Movies

Post by ronwill » 2021-01-13 16:50

I still can't get YouTube thumbnails to display in table view!

Any solutions?
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: YouTube Video Link/Movies

Post by pbottcher » 2021-01-13 22:35

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.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

User avatar
ronwill
Veteran Member
Posts: 228
Joined: 2015-08-08 10:12
Location: Cheltenham UK +Weatherford USA

Re: YouTube Video Link/Movies

Post by ronwill » 2021-01-14 00:15

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
Ron - Gloucestershire, UK: AppGini Pro V 23.15 Rev 1484 - LOVING IT!
Plugins: Mass Update + Search Page Maker + Summary Reports + Calendar + Messages
Bizzworxx: AppGiniHelper + Inline Detail View
Alejandro Landini: To-Do List + MPI + TV Field Editor
Other: Udemy Course

Post Reply