I tried to return my video (mp4) after receiving the content, after which I encoded it base64, but my video still does not play. I tried the code below with images and it works. Why doesn't it work with video?
<?php $con=file_get_contents("kecak.mp4"); //kecak.mp4 work to play with <video> </video> tag $en=base64_encode($con); $binary_data='data:'.$mime.';base64,'. $en ; ?> <video width="320" height="240" controls="controls"> <source src="<?php echo $binary_data ?>" type="video/mp4" /> Your browser does not support the video tag. </video>
source share