Can't get video meta from wp_read_video_metadata() in Localhost (xampp) | Not Working
I tried to get video information such as time and size using getid3 ( wp_read_video_metadata()
)
Here is my code:
require_once( ABSPATH . 'wp-includes/ID3/getid3.php' );
$filename = 'https://localhost/project/wp-content/uploads/2021/08/myvideo.mp4';
$getID3 = new getID3;
$file = $getID3-analyze($filename);
echo Duration: .$file['playtime_string'];
But it just returns: Duration:
I used the getid3 library on the Cpanel and it worked! So I think the problem is with the localHost.
I also tried to print_r()
the $file variable:
(
[GETID3_VERSION] = 1.9.20-202006061653
[error] = Array
(
[0] = Could not open https://localhost/project/wp-content/uploads/2021/08/myvideo.mp4 (!is_readable; !is_file; !file_exists)
)
)
But I'm sure that my file exists. When I enter it directly into the browser, the video will be downloaded for me.