Playing SWF and MP4 through a media player

General discussions related to php

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Fri Feb 01, 2013 2:56 am

Playing SWF and MP4 through a media player

Postby jaybo8838 » Fri Feb 01, 2013 3:00 am

Hi Guys (and girls).. I am new to this PHP and self taught so please be gentle with me..! I have a system I created at work where clients can log in and view their advert online, they log in with a unique contract number and then the PHP script looks for the advert within our FTP (that we uploaded) and it plays their advert, the advert could be either an SWF or MP4. The problem I have is if they are viewing on an iPhone we have to supply an MP4 beauce they can't see the SWF (flash file), the MP4 is a huge file and takes too long to load where as the swf is vertially instant. What I want to do is get some sort of media player on the proofing area that handles both SWF and MP4 and streams it rather than waits for it to fully load before it plays it. At the moment i have the advert to appear in an iFrame at 800x600 (actual advert size) and it simply looks for "<?echo $file;?>" ..!! My question is, how do I get the "<?echo $file;?>" to play within a media player (example JW Player)..?

PLEASE HELP (If I have not confused you too much)


Jay (41 year old newbie.. :-0)

php-forum Fan User
php-forum Fan User
Posts: 973
Joined: Mon Oct 01, 2012 12:32 pm

Re: Playing SWF and MP4 through a media player

Postby seandisanti » Fri Feb 08, 2013 1:30 pm

check out Tversity media server. It performs real time transcoding according to the device requesting the file. Serviio does the same I believe, and works in more environments (tversity was windows only when I started using it at home and haven't bothered to switch yet because it does a great job). Anyway; the way that it would work, would be that you'd have a library of all of the videos, format doesn't matter, and you'd make that your library for tversity. Then you'd store the urls in the database, like....'http://serverip:41952/folder/adverts/1234.swf" or whatever. When they go to that address, it will start playing for their device. I'd suggest including it in another page of course to hide the url etc but I think it would work for you.

Return to “PHP General”

Who is online

Users browsing this forum: No registered users and 3 guests