homepage Welcome to WebmasterWorld Guest from 54.227.77.237
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
help needed getting a flash-flv displayed via php
Oliver Henniges




msg:3812509
 12:28 am on Dec 22, 2008 (gmt 0)

I am currrently trying to embed the first videos on my site, and following most recommendations I would like to stick to the widely spread youtube-standards.

If I understood things correctly, the core video is stored as a flash-video in flv-format, but you need an swf-container to show it (otherwise the media player attempts to download the file instead of displaying it within the website. The alternative way is to embed a player via javascript?)

I found that php offers a number of flash-functions coming along with the ming-framework. I find that quite convenient, because I think this bears the chance to add sequences to the video just by modyfying the php code instead of generating a comeletely new video.

However, experimenting with some of the code snippets found here on webmasterwolrd and some other resources I didn't get a single stream displayed properly, yet. So my first question is:

What do I have to do to get ming running? I uncommented the appropriate line in php.ini, and my php-info file (php 5.0.5) shows two rows:

Ming SWF output library enabled
Version 0.3beta1

Does this mean all necessary compontents are installed? Or is any additional graphics-library required? Is ming deliverd with the php 5 bundle or do I have to download anything additional?

Heres my html code:

<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" width="450" height="450"
codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=7,0,0,0">
<param name="movie" value="ming2.php">
<param name="quality" value="high">
<param name="scale" value="exactfit">
<param name="menu" value="true">
<param name="bgcolor" value="#000040">
<embed src="ming2.php" quality="high"
bgcolor="#000000" width="450" height="450"
type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="true"
pluginspage="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object>

It is supposed to embed an experimental file named "ming2.php", which currently looks like this:

<?php
$filename = "test1.flv";
ming_useswfversion(6);
$s = new SWFVideoStream();
$s -> __construct ($filename);
$m = new SWFMovie();
$m -> add($s);
header('Content-type: application/x-shockwave-flash');
$m->output();
?>

Which, of course, doesn't work.

1) What are the minimum lines of code necessary to get that file "test.flv" displayed in a flash-player? (this test-file works fine, it is shown in e.g realplayer the way it should).
2) How could I add some seconds of an image-dump-jpeg in the beginning?
3) How can I add some seconds of a "page" containing some text?
4) What do I have to add to get these "play", "rewind" "forward-" etc buttons displayed?

Any help is well appreciated. I know, that the easiest way would probably be to buy adobe products and create the swf-file from that, but I 'd really love to learn more about the way flash videos are created and the elements they may contain.

 

d40sithui




msg:3812861
 4:46 pm on Dec 22, 2008 (gmt 0)

I don't know the answers to your questions, but I have been using a pretty neat flash player. The good thing about this player is that it's got a playlist feature and is fully customizable. It requires an XML playlist format to load the playlist. Of course, you can always choose to play only one video in which case you would only include one video inside the playlist. Here is a simple snippet to embed.

<embed
src="http://mySite.com/flash/mediaplayer.swf"
width="600"
height="300"
allowscriptaccess="always"
allowfullscreen="true"
flashvars="width=600&amp;height=300&amp;file=http://mySite.com/flash/playlist/myPlaylist.xml&amp;autoscroll=false&amp;shuffle=false&amp;showdownload=false&amp;displaywidth=350"
/>

It's pretty nice I think and will probably take care of your current problems. Here is their website to download the "mediaplayer.swf" along with the player resources. [developer.longtailvideo.com...]

Oliver Henniges




msg:3813030
 10:05 pm on Dec 22, 2008 (gmt 0)

thxalot so far.

Yes, I found a number of freely available players on the web. The resource you gave seems very well organized and I'll have a look tomorrow and try to get my application running with this workaround.

Nevertheless, I thought php offered it's own means to develop such a player within all the swf-commands, but it seems this part is highly experimental at the moment, and I think my hoster doesn't support it by default, yet. It would be very nice if one day I'll be able to handle flv-files form within pure php. Keep things simple, so to speak.

Oliver Henniges




msg:3813673
 11:51 pm on Dec 23, 2008 (gmt 0)

Again thank you very much for the link.

After a whole week of experimenting with the php-swf-functions I installed the player you recommended and managed to integrate and ftp the video to my website within a single day.

In contrast to some other resources I came across the past days, this site has a very clear an straightforward usability and documentation, which made it quite easy to install the package. I had some trouble to find the price for a commercial license, which was hidden in a dropdown-menu of the form, though. Could be presented a bit more visible.

I'm not really sure, whether I made everything the best way: I used the recommended pure javascript-installation

a) because it is definitely w3c-conform and
b) I never got anything to work yet with the <object>...<embed>- html syntax. Dunno why, I think I'm a bit stupid here.

However: I almost got a shock when I watched the video on an older computer in my company, which had a lower flash-version installed: This javascript solution does not automatically try to install the newest adobe flash-player. So as a workaround I present some explanatory text and a href-link to adobe.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved