pixelead0 / tmdb_v3-PHP-API-

Wrapper in PHP for The Movie Data Base version 3
119 stars 81 forks source link

Empty youtube video problem #63

Closed DarKl4ne closed 4 years ago

DarKl4ne commented 4 years ago

Hello

I have a problem with the youtube video displays. When the video exists in a film no worries everything works fine. The problem comes when there is no id of the youtube video I have this error Notice: Undefined offset: 0 in C:\wamp64\www\pacaprez\engine\inc\class\api\tmdb\controller\classes\data\Movie.php on line 184

Here is the code in question for the error ` /**

So I would like to know how to not display when it is empty. Here is the code I use when there is a video `echo '

Bande Annonce


';` Thanks for your help and for your script
bogdanfinn commented 4 years ago

@Hellsangels i fixed the undefined offset issue on my fork bogdanfinn/tmdb_v3-PHP-API- Nevertheless you have to check if the trailer is empty or not.

I added an example how to check for empty trailer in the infoMovie.php ;-) Check the commit out

DarKl4ne commented 4 years ago

I looked at the infomovie.php file and I didn't see any verification. Because the film I'm showing has no video, it's empty. So I thought of an if but it doesn't work

DarKl4ne commented 4 years ago

Ok I found my answer here https://github.com/alvaro-octal/TMDB-PHP-API/commit/e945a75adc594c23f70504d2eda27f347f8fb78e I think you could update the file

bogdanfinn commented 4 years ago

@pixelead0 issue can be closed

pixelead0 commented 4 years ago

Thanks @bogdanfinn