473,800 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PHP and Flash movies

Hello!

I'd like to allow users to upload Flash movies to my website and have
them displayed in a page.

There are certain things that I either need in order to display them
correctly, such as the version of Flash, the width/height of the movie, etc.

Does anyone know if there is any existing code available to do this?
Ideally, I would like to not ask for -anything- from the user, except
for the actual Flash movie.

Thanks for your help!
Jul 17 '05 #1
2 1627

"LL2000" <li************ **********@yaho o.co.uk> wrote in message
news:rh******** ***********@fe2 .news.blueyonde r.co.uk...
Hello!

I'd like to allow users to upload Flash movies to my website and have
them displayed in a page.

There are certain things that I either need in order to display them
correctly, such as the version of Flash, the width/height of the movie, etc.
Does anyone know if there is any existing code available to do this?
Ideally, I would like to not ask for -anything- from the user, except
for the actual Flash movie.

Thanks for your help!


Here's something I wrote. Not terribly efficient or well written but works.

function ExtractSWFInfo( $path) {
// read the data
$data = file_get_conten ts($path);

// signature
$sign = substr($data, 0, 3);
if($sign == 'CWS' || $sign == 'FWS') {

$compressed = ($sign{0} == 'C');
$version = ord($data{3});

// file length
extract(unpack( 'Vlength', substr($data, 4, 4)));

$data = substr($data, 8);
if($compressed) {
$data = gzuncompress($d ata);
}

// frame coordinates, first 5 bit is the number of bit per coord
$b = ord($data{0});
$nb = $b >> 3;
$bin = decbin($b & 0x07);
$bits = substr('000', 0, - strlen($bin)); // 0-padded
$bits .= $bin;

// read the bits
$index = 1;
for($bits_requi red = $nb * 4; $bits_required > 0; $bits_required -= 8) {
$bin = decbin(ord($dat a{$index++}));
$bits .= substr('0000000 0', 0, - strlen($bin));
$bits .= $bin;
}

// cut bitstring into four parts
$coord_bits = array();
for($i = 0, $j = 0; $i < 4; $i++, $j += $nb) {
$coord_bits[$i] = substr($bits, $j, $nb);
}

// convert from bin to integer
$coord = array();
for($i = 0; $i < 4; $i++) {
$num = bindec(substr($ coord_bits[$i], 1));
if(substr($coor d_bits[$i], 0, 1) == '1') {
$num = -$num;
}
$coord[$i] = $num;
}

// get the dimension in pixels
$width = round($coord[1] / 20);
$height = round($coord[3] / 20);

// frame rate and count
extract(unpack( 'Cframerate_dec im/Cframerate/vframecount', substr($data,
$index, 4)));

return compact('compre ssed', 'length', 'version', 'width', 'height',
'framerate', 'framecount');
}
return false;
}

$file = "C:/Documents and Settings/cleong/Desktop/cow_test.swf";

var_dump(Extrac tSWFInfo($file) );


Jul 17 '05 #2
Chung Leong wrote:
"LL2000" <li************ **********@yaho o.co.uk> wrote in message
news:rh******** ***********@fe2 .news.blueyonde r.co.uk...
Hello!

I'd like to allow users to upload Flash movies to my website and have
them displayed in a page.

There are certain things that I either need in order to display them
correctly, such as the version of Flash, the width/height of the movie,


etc.
Does anyone know if there is any existing code available to do this?
Ideally, I would like to not ask for -anything- from the user, except
for the actual Flash movie.

Thanks for your help!

Here's something I wrote. Not terribly efficient or well written but works.

<snip>

Thank you very much. That's perfect. You've saved me hours of work and
restored my belief in newsgroups :)

LL.
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6500
by: S³awek Mróz | last post by:
Hello! I'm a beginner in C# programming and I'm wondering if it's possible to put Macromedia Flash movies and C# applications working together. If yes and you know some good web-articles giving explanations and examples - pls let me know the links. BR Slawek
0
1104
by: simchajoy2000 | last post by:
Hi, I have a series of flash movies imbedded in my webpage and for users who use dial-up, these movies obviously open up at a different rate. However, this not only makes the webpage look very busy but some of them actually have to be in sync for it to make sense. Is there a way for me to tell the client using ASP.NET to only display all the movies after the last one has been loaded? The url for my website is: MBimagery.com and this...
8
4061
by: Ben Bartsch | last post by:
Looking for opinions on the use of Flash with ASP.NET. Has anyone here seen or conducted any implementations of Flash that are actually useful or otherwise complement ASP.NET?
6
1917
by: Andy G | last post by:
I have a client that is really pushing me to start using Flash MX Professional to replace VS.NET. Main arguement is that it looks better and flows nicer than visual studio developed applcations (this client is a designer not a programmer). I believe that Flash is a 'Tool' not a 'Solution'. My 'Solution' is an ASP.NET application but I would like to use Flash as a 'Tool'. I am having very hard time seeing any documentation on the...
115
13342
by: post2google | last post by:
I was thinking about where to go for lunch the other day, so I went to hardees.com to see what the menu looked like these days. What comes up is a big note that my flash version is not new enough so I can't use the site. What complete losers! When are businesses going to understand that the purpose of a web site is to communicate with customers or business parterns and NOT so your "web master or "web engineer" can show off what they...
5
5951
by: ASP.NET explorer | last post by:
I have been asked to create some simple animation using Adobe Flash player in ASP.NET(C#) web application. While I am fairly well versed with ASP.NET C#, I absolutely have NO IDEA about how to say "Hello World" in a Flash enabled web page rendered via ASP.NET. Can any one let me get started? ---
2
8093
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I did not understand some parameters totally in the HTML tag. These days when I was surfing the Internet I have found some comprehensive introduction to these two tags. I read it and conclude it with my own words; I think it will be useful to us, so I...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.