swfobject to embed the swf in my html or PHP - php

I am using PHP language and I have a swf file . I am using swf file for the first time so I don't know how to use swfobject to embed the swf in my html or PHP . I just know how to use php but I don't know anything about swf embedding . I can't give you the code also because I am not able to figure out the way to do

This is the simple way of embedding swf file in HTML
<object width="100" height="100">
<param name="movie" value="file.swf">
<embed src="file.swf" width="100" height="100">
</embed>
</object>

Related

How can I show a PDF file in a browser from my database?

I want to show a PDF file in the browser from the database using embed tag of HTML. How can I do this? Here is my PHP Code:
$content_query="select * from time_table where semester_no=$current_semester";
$apply_query=sqlsrv_query($conn,$content_query);
$result_content = sqlsrv_fetch_array($apply_query);
$file_directory=$result_content['file_path'];
$exists=file_exists($result_content['file_path']);
$ext=$result_content['name'];
echo $direc="../admin/pages/".$file_directory; exit;
$path=$direc.$file_directory;
You can simply add this to your html code, (this assumes your pdf is stored in a publicly accessible path)
<embed src="{{url_to_pdf}}" width="1920" height="1080"/>
Or optionally you could also use this,
<embed src="https://drive.google.com/viewerng/viewer?embedded=true&url={{url_to_pdf}}" width="1920" height="1080">

Download an embed swf object from a webpage to server

I know how to cache images from webpages, and save them.
But i wanna know how download a "application/x-shockwave-flash" file from a webpage with the element below :
<embed type="application/x-shockwave-flash" src="/media/player/flvplayer.swf" width="550" height="450" style="undefined" id="single" name="single" quality="high" allowfullscreen="true" menu="false" flashvars="file=/files/fa/news/91/11/12/143130_319.flv&width=550&height=450">
OR think it as i want to extract the link of file.
From what i see above, the link to file is :
http://domain.com/files/fa/news/91/11/12/143130_319.flv
How to extract it ? ( suppose that some flashvars attributes are not exactly as above )
Or any other idea would be appreciated.

Issues with embedding WMV files in html

I have a link to play a video in my website. When a user click on that video link, the div which embedded that video will popup(not popup window, its showing hidden div using jquery BlockUI). And there is close button it will hide the div which embedded video.
Everything is working fine. But video is not stopping on closing that div. I can hear the sound :( . I want to stop that sound too on closing that video. What to do. Please do the needful
<OBJECT ID="MediaPlayers" WIDTH="400" HEIGHT="350" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="1.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="1.wmv" NAME="MediaPlayer"
WIDTH="400" HEIGHT="350" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
Try to use this when you close the popup window.
document.getElementById("MediaPlayers").stop();
Or you can use another div to wrap this player, and then add your html into innerHTML when open popup window and then remove all when you close the window. like
<div id="playerWrap">
<OBJECT ID="MediaPlayers" ....
.....
</OBJECT>
</div>
javascript code:
document.getElementById("palyerWrap").innerHTML = "";
reference by http://www.htmlforums.com/multimedia-elements/t-accessing-mediaplayer-functionality-from-javascript-65899.html
if you want everybody to be able to your video, you should use the html5 video tag instead. this will not only relieve you from unexpected behavior of propriatory plugins (windows media player) but also allow you to reach a broader spectrum of devices and therefore a bigger audience.
i suggest to convert you video to the webm format and using jplayer to display it on your site.

Embedding Video Code with PHP

I am developing a web application with backend administration panel that allows users to insert video embedding code. This code will render the video on the corresponding page as i am echoing that code at that location.
The problem is that, when i echo the code, the code itself gets displayed instead of video being shown. Where i am going wrong?
Here is the code entered by user in the textarea in admin panel:
<pre>
<object id="vp110mFH" width="432" height="240" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param name="movie" value="http://static.animoto.com/swf/w.swf?w=swf/vp1&e=1340255540&f=10mFH15tm8Wyv1UT85DhEA&d=72&m=p&r=360p&volume=100&start_res=360p&i=m&ct=Click...To%20request%20more%20Info..&cu=http://schoolanduniversity.com/study_programs/more-information.php&options="></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed id="vp110mFH" src="http://static.animoto.com/swf/w.swf?w=swf/vp1&e=1340255540&f=10mFH15tm8Wyv1UT85DhEA&d=72&m=p&r=360p&volume=100&start_res=360p&i=m&ct=Click...To%20request%20more%20Info..&cu=http://schoolanduniversity.com/study_programs/more-information.php&options=" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="432" height="240"></embed></object>
</pre>
Please guide.
Regards,
Mrinal Purohit
It seems like you are displaying the html entities for your embed code, you could try using html_entity_decode() to get around this. Of course a better solution would be to store the embed code in the correct format, ie not encoded as entities.

How to embed a quicktime video from a MySQL Blob

I am currently pulling out images from a MySQL Blob using code as follows:
<img src="data:<?php echo $type; ?>;base64,<?php echo base64_encode($file); ?>" width="240"/>
I am now trying to embed a movie in a page and I am currently using code as follows:
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="256" width="320">
<param name="src" value="http://www.yourdomain/your-video.mov">
<param name="autoplay" value="true">
<param name="type" value="video/quicktime" height="256" width="320">
<embed src="<?php echo base64_encode($file); ?>" height="256" width="320" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed>
</object>
I'm not sure how to go about actually grabbing the data? Any ideas?
Refer the video to a URL like:
http://www.yourdomain/video.php?video_id=1234
In video.php, notify to the browser about the MIME type via the Content-Type header that you can send with the header() function.
BTW, it's the first time that I see someone uses the method you've shown to display an image.
Usually, you'd want to refer to a URL like the example above.
That's because that the browser will save the image in the cache, which will make your website to load faster.

Categories