How to create video player in php with play & fullscreen button? - php

I have got the below code from internet for embedding a video player but it doesn't have play/pause button or fullscreen option.
Here is the code:
<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=342
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..."
TYPE="application/x-oleobject">
<PARAM NAME="movie" VALUE="<?php echo $path.'/'.$_POST['file']; ?>">
<EMBED TYPE="application/x-mplayer2"
SRC="<?php echo $path.'/'.$_POST['file'];?>"
NAME="MediaPlayer"
WIDTH=320
HEIGHT=342>
</EMBED>
</OBJECT>
Any code fix please?

<OBJECT ID="MediaPlayer" WIDTH="300" HEIGHT="200" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="<?php echo $path.'/'.$POST_['file']; ?>">
<EMBED TYPE="application/x-mplayer2" SRC="<?php echo $path.'/'.$POST_['file']; ?>" NAME="MediaPlayer" WIDTH="200" HEIGHT="200" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"></EMBED></OBJECT>

Better use some free flash based player and embed this on the website, this code you have pasted here - with windows media player - works very badly.
Beside it's very insecure. Easy to do cross site scripting if you don't filter _POST/_GET/
http://www.longtailvideo.com/players/jw-flv-player/

Users may need plugin to display media player in other browsers other than internet explorer. I recommend you to use a flash based player.
http://www.longtailvideo.com/players

{
<video width="720" height="430" autoplay *controls preload="none*">
<source src="" type="video/mp4">
<source src="" type="video/ogg">
//Your browser does not support the video tag.
</video>enter code here
}
add controls

Related

Strange Muted, Autoplaying Behaviour on Wordpress Video

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

Video JS-- How do I remove the playback controls?

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 ...>

Play audio tag with blob inside on mobile

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 :)

how to pull flash video from mysql with php

im trying to pull .swf files from MySQL by using PHP, ive set everything in the database up with an ID and licked it properly. Im not sure if the 'type' has to be anything special, right now its just a 'VARCHAR' and when altering the javascript part of it that that flash automatically generated-- in the i tried to echo it out by putting it in the value like
< param name="movie" value="<?php echo $row['video_path']; ?>" />
but thats not working
<object width="550" height="400">
<param name="movie" value="<?php echo $row['video_path']; ?>">
<embed src="<?php echo $row['video_path']; ?>" width="550" height="400">
</embed>
</object>
I hope this is what you are trying. You getting the video path from mysql ..

How to add silverlight player to browser and load our own video using PHP?

Im Implementing a video broadcasting website. For that I planned to use silverlight player to load videos. But I dont know how to integrate silverlight player into browser and load my own video in that player. Please Give me some code snippets or Some good references. Any help will be highly appreciated.
First of all you need a Silverlight player just like you need a FLV player for Flash videos.
I recommend: http://www.codeplex.com/sl2videoplayer
All the installation instructions are explained in great detail at: http://sl2videoplayer.codeplex.com/Wiki/View.aspx?title=installation%20instructions
It is simply a matter of including a small HTML snippet in your document:
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="640" height="480">
<param name="source" value="ClientBin/VideoPlayer.xap"/>
<param name="background" value="white" />
<param name="initParams" value="m=Bear.wmv" />
<param name="minruntimeversion" value="2.0.31005.0" />
<a href="http://go.microsoft.com/fwlink/?LinkId=124807" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
</div>
Assuming the silver light player is located in ClientBin/VideoPlayer.xap and the video you want to play is called 'Bear.wmv' located in the same directory as the .xap file (so that becomes ClientBin/Bear.wmv).

Categories