This is my html
<div align="center" class="embed-responsive embed-responsive-16by9" width="640" height="480">
<video autoplay loop class="embed-responsive-item" controls>
<source src="/projects/moviestream/php/stream.php">
</video>
</div>
and my stream.php
// class definition of video_stream
$stream = new VideoStream($video_link);
$stream->start();
My question is how to pass the variable $video_link from my html to the php page so it streams the correct video?
Found a solution using just plain php!
I use a kind of php router that allows me to route movie/1 to VideoStreamer and invoking the method stream($id) wwith $id set to 1
Related
I am trying to set the poster image of an HTML Video via PHP, but no luck so far.
<video class="friend-video" width="100%" poster="<?php the_sub_field('thumbnail_select'); ?>" muted loop>
Does anyone know how I could make this work?
I'm using Advanced Custom Fields.
I'm trying to embed an self hosted video into a wordpress page. This is a video hosted in the media library on the same wordpress install.
But I'm having difficulties getting the video to appear on the page, not on autoplay and with sound.
It seems to either:
appear with no play button (looks like a static image)
appear autoplaying but with no sound.
I've tried various settings on the page code to get this to appear like a regular video with a play button that's not set to autoplay but I'm stumped.
These were the settings when I came to change them
<div class="video-area">
<video width="100%" autoplay muted>
<source src="<?php the_field('video_section_video') ?>" type="video/mp4">
</video>
</div>
I then tried this:
<div class="video-area">
<video width="100%" muted="false" autoplay="false">
<source src="<?php the_field('video_section_video') ?>" type="video/mp4">
</video>
</div>
And I also tried changing the original default settings to removing autoplay and muted, but no combination of changes seems to have the effect I want.
It's either static and no option to start the video, or it plays automatically without sound. I understand browsers dont allow videos to autoplay these days with sound, but I just need it to appear like a regular video with a play button.
You are missing controls
<div class="video-area">
<video width="100%" muted="false" autoplay="false" controls>
<source src="http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4">
</video>
For your reference: https://www.w3schools.com/html/html5_video.asp
I am using VideoJS to play videos on my page, how do I remove the playback controls?
I want to auto play once the page is loaded without controls, once the playback is done I want to trigger a webservice.
any ideas on how to do this?
Michael
<video id="my-video" class="video-js" controls preload="auto" width="640" height="264" poster="images/loader.gif" data-setup="{}">
<source src="test.mp4" type='video/mp4'>
<source src="test.webm" type='video/webm'>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
supports HTML5 video
</p>
</video>
http://videojs.com/
write this attribute , i think your problem will be solve
<video autoplay ...>
i've made this script:
<?php
if(!empty($dati['audio'])) { ?>
<span>
<audio id="audio_player" src="data:audio/mp3;base64,<?php echo base64_encode($dati['audio']);?>" controls="controls" autobuffer="autobuffer">
</audio>
</span>
<?php } ?>
It create an audio tag with a blob value inside..it work in every browser on pc but it won't work on some mobile browser..i've tried with external library to play audio in different way but it look like no one allow blob instead of the path of the file..someone have an idea which can help me to solve this problem?
replace data:audio/mp3 to data:audio/mpeg
This link will be useful too.
If not working. Try this onle also.
<audio id="audioFile" controls="controls" loop="loop" autoplay="autoplay" >
<source src="filename.mp3" type="audio/mpeg" />
<source src="filename.ogg" type="audio/ogg" />
</audio>
Hope it will work for you :)
I want to play the audio file while is retrieved from the mysql database as blob file in php. But when i run the file, the php file is downloaded.
Here is my code
<?php
$file_path = "H:\\uploader\\John.mp3";
?>
<audio src="<?php echo $file_path;?>" preload="auto" />
can anyone help me to solve this problem.
You're not showing any examples of what you're tried with mysql, but maybe this will point you in the right direction:
http://php.net/manual/en/pdo.lobs.php
Edit:
Try including the embed element:
<?php
$file_path = "H:\\uploader\\John.mp3";
?>
<audio controls>
<source src="<?php echo $file_path;?>" type="audio/mpeg">
<embed height="50" width="100" src="<?php echo $file_path;?>">
</audio>