Download an embed swf object from a webpage to server - php

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.

Related

swfobject to embed the swf in my html or 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>

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.

Programmatically Embed Blip.tv Videos

I'm trying to build a php video embedding function that parses the video URL automatically and then produces the right embed code out of that. I'm having trouble with the new blip.tv player because there is no reference the the video in the url that makes sense in the embed code. Here goes an example:
URL: http://blip.tv/NovusSwell/s3w31-hawaii-surfer-groms-with-potato-cannon-spud-gun-5471671
Embed Code:
<embed src="http://blip.tv/play/g8hQgs38GwI" type="application/x-shockwave-flash" width="550" height="327" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" ></embed>
g8hQgs38GwI is the video Id that I cannot guess out of the URL.
Is there a solution to this?
According to Blip.tv Wiki here's what you need to do:
Get the RSS version of the item: http://blip.tv/rss/view/5471671 (Get id from the URL).
Parse what you got at step 1 (RSS is basically an XML file): Using XPath, the copy/paste code is found at /rss/channel/item/media:player

How would I make a playlist editor for mp3 flash object?

I have an mp3 player embedded into my site and would like to have a box on my site where they can edit playlist. I need to know, How would I begin to make a playlist editor in php for an mp3 flash object?
..So they may add songs/edit songs/delete song if posted , etc
<object style="position:absolute;top:1px;left:400px;z-index:12;" type="application/x-shockwave-flash" data="http://flash-mp3-player.net/medias/player_mp3.swf" width="200" height="20">
<param name="movie" value="http://flash-mp3-player.net/medias/player_mp3.swf" />
<param name="bgcolor" value="#94C0DF" />
<param name="FlashVars" value="mp3=http%3A//flash-mp3-player.net/medias/another_world.mp3&volume=50&showinfo=1&bgcolor=94C0DF&bgcolor1=B4E8FB&bgcolor2=B4E8FB&buttoncolor=330026&slidercolor1=888888&sliderovercolor=00d600" />
</object>
According to the user forum of "flash-mp3-player.net", you just serve up the playlist in a particular text format. So you'll want to use some kind of database to associate "playlists" with the "tracks" there, and when someone requests a given "playlist", you query that database and generate output of the correct format (as specified in the above URL) as the response.

upload videos from youtube

I'm going to store the video embed code from youtube since users can upload videos. What should be the data type of the field where I would store the video embed code.
Video embed code like this:
<object width="640" height="385">
<param name="movie" value="http://www.youtube.com/v/M8uPvX2te0I?fs=1&hl=en_US"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/M8uPvX2te0I?fs=1&hl=en_US"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="640" height="385"></embed>
</object>
How much of that actually varies by video? You could either store the whole snippet as a string, or just store the relevant sections - in particular, the clip ID (M8uPvX2te0I) and possibly the width and height, if that varies. Storing the relevant data instead of the verbatim HTML will make it easier to serve different HTML from your existing data if the "template" changes or if you want to serve different HTML to different clients.

Categories