This is a message.

Flowplayer in all Flash site Created Nov 24, 2008

This thread is solved

Views: 4242     Replies: 36     Last reply Jul 7, 2010  
You must login first before you can use this feature

astrofunk

Posts: 1

Registered:
Nov 24, 2008

Flowplayer in all Flash site

Posted: Nov 24, 2008

Do you need an html site to use Flowplayer? I'm building a site using Flash only and am wondering if this player will work for me.

I'm new to this sort of thing, so forgive me if this is a stupid question. Thanks!

davidcollantes

Posts: 8

Registered:
Oct 5, 2008

» Flowplayer in all Flash site

Posted: Nov 26, 2008

Reply to: Flowplayer in all Flash site, from astrofunk
Are you building the site, or someone else is doing it for you? If you are building the site, you should know. If someone else is building it for you, they should know.

To answer the question, I am not sure if Flowplayer is embeddable from within another flash, but since it is open source, if it is not possible now (compiled product) it should be possible to do having the sources. You will need to know Flash though...

sgenevay

Posts: 3

Registered:
Jun 25, 2010

» Flowplayer in all Flash site

Posted: Jun 25, 2010

Reply to: Flowplayer in all Flash site, from astrofunk
hey astrofunk ... knows it's 2 years after... but i'm in the case u were at this time... beginner in flash and impressed by the smart answer to your question from davidcollantes... who maybe forgot he was beginner one day either..... did u find a way to make it work ?
redards

Danno

Posts: 19

Registered:
Jun 24, 2010

» » Flowplayer in all Flash site

Posted: Jun 25, 2010

Reply to: » Flowplayer in all Flash site, from sgenevay
I think I'm trying to do the same thing. I'm a flex developer just trying to use the player as a component in a flex application. Sounds simple. This flowplayer seems to be targetted at the "embed in html page" market. I wanted to take the flowplayer.swc library and then add the flowplayer component to my flex project and wrap it with controls to select video yada yada.

For some reason that nobody will respond to, they've removed the flowplayer.swc file from the flowplayer.devkit repository somewhere maybe back around r900 or so. So I've been trying to follow their build procedure to no avail. I'm thinking my best approach would be to take the source, pull it into a flex library project and then use it in my flex project where I want an embedded video player. But the lack of support for the thousands of issues here is making me revisit whether it is a smart move going forward. My sense is that there are some problems with commitment going forward and this may be an abandoned ship in the not too distant future. Source would be the only way to go forward, but not sure I want to dig too deeply into this.

So on the topic of this thread, importing source into a flex library project might be what you're looking for to generate an all flash component that you could deploy in whatever way you want, or if you have a flowplayer.swc, add it to your lib directory (assuming you have a flexbuilder or flashbuilder dev environment) and then try to figure out from their docs how to use the component and set the right properties to make it fully functional.

If you figure out a better way to do this...do tell.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » Flowplayer in all Flash site

Posted: Jun 25, 2010

Reply to: » » Flowplayer in all Flash site, from dannyv
Hi,

Embedding Flowplayer in Flash is totally feasible, although it's quite complex if you want to handle the resize correctly and call Flowplayer's APIs. The flowplayer.swc file disappeared from the repo because it changes each time there's a commit in the core.
Anyway, the flowplayer.swc wouldn't help because you would need to do some deep changes in the code before being able to using it.

I did some code some time ago to embed FP from AS3 code with a static configuration :

var playerConfiguration = '{"clip"%3A"http%3A%2F%2Fe1h13.simplecdn.net%2Fflowplayer%2Fflowplayer.flv"}';
 
var context:LoaderContext = new LoaderContext();  
//context.securityDomain = SecurityDomain.currentDomain;  
//context.applicationDomain = ApplicationDomain.currentDomain;  
             
Security.allowDomain("*"); 
Security.allowInsecureDomain("*"); 
var resourceLoader:Loader = new Loader(); 
var resourceRequest:URLRequest = new URLRequest("flowplayer-3.1.5.swf"); // player url is FP's url 
                 
resourceLoader.contentLoaderInfo.addEventListener(Event.INIT, function(event:Event):void {  
    trace("Player INIT event"); 
    var preloader:* = event.currentTarget.content; 
    preloader.injectedConfig = playerConfiguration; // playerConfiguration is a json string 
    parent.addChild(preloader);  // _parent is my main Sprite 
}); 
 
resourceLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(event:Event):void {  
    trace("Player COMPLETE event"); 
                         
    var progressEvent:ProgressEvent = new ProgressEvent(ProgressEvent.PROGRESS); 
    progressEvent.bytesTotal = 100; 
    progressEvent.bytesLoaded= 100; 
   // fake event to tell FP that it's loaded         
    //event.currentTarget.content.onLoadProgress(progressEvent); 
    waitForPlayer(); 
    // this function will wait for player 
}); 
                     
resourceLoader.load(resourceRequest, context); 

I have some plans to do a Flex wrapper for Flowplayer with my company in a near future. In the meantime you can contact us if you need custom dev to include FP and handle resize/access APIs.

Cheers,
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » Flowplayer in all Flash site

Posted: Jun 25, 2010

Reply to: » » » Flowplayer in all Flash site, from blaaaaaaah
thanks for that Thomas. I probably need to do a bit more reading to understand the complexities you speak of.

My expectation was that the player was a swf, with exposed api such that a plugin control bar could initiate controls based on user interaction. (pick up event on control or some other flex control, then call player api... ) In that case, no mucking with the internals would be required assuming those apis let me supply the video source url, initiate a play, pause command etc...nothing complex...steering wheel, gas pedal....and brake...

Size would be controlled with exposed properties, or at least setters/getters of required properties.

General config would be controlled by a properties file of some kind, which could be made compile-time or run-time configurable.

It looks from your code like the injectedConfig object does some of that config work.

Actually, it looks like you're just loading the flowplayer.swf into a sprite container and handing it a video source via the injectedConfig object?

Am I missing some architectural details about the player and how the ocnfig is exposed? Do you have any documentation that discusses this topic. Maybe the flowplayer javascript infers how to config the player? Yes, I admit I was looking for an easy integration but let me understand the complexities first and can determine if I'll undertake it.

thanks,

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » Flowplayer in all Flash site

Posted: Jun 25, 2010

Reply to: » » » » Flowplayer in all Flash site, from dannyv
Hi,

Unfortunately the APIs aren't accessible directly through the main SWF you load (the Preloader class), but on the FlowplayerBase class and there's no way to access it easily.
To get access to the Flowplayer instance you can either patch the player or create a custom plugin that will only hold a static reference to the player with a static getter.

About the resize, FP uses the Stage's size and you need to patch the player in several places to make it resize as you want, as there's no setSize API. To get that done, you will need to patch the MarginLayout.as file, remove all the listeners to the Stage's resize, and change the size of the Panel instance manually. You can access that by recursively iterating through the children of the container Sprite and finding the good one.

Pretty simple ;)

Indeed, I'm just loading the player's swf and injecting a static config. There's no documentation about that, the only thing you can do is getting your hands dirty by looking at the code.

Hope it answers all your questions,
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » Flowplayer in all Flash site

Posted: Jun 25, 2010

Reply to: » » » » » Flowplayer in all Flash site, from blaaaaaaah
Thanks again Thomas,

I think you've given me the map to get where I want to go, just not sure I want to go there anymore :-)

For whatever reason, the build process described in the flowplayer document fails for me because the build.xml is referring to a content directory and some plugin directories that don't exist. Getting it built outside of flexbuilder is a pain and patching in flexbuilder then building outside will make things slow, so I gave up on the external build.

For that reason I started an attempt to pull the flowplayer and control source into a Flex Library project and generate my swc from there (or just pull the lib project reference into myCustomerFlowPlayer project.) I just hit a snag there because of some problem with property namespace references:

1120: Access of undefined property hasSlowMotion.(CONFIG::hasSlowMotion). That doesn't like a tough one as I probably missed moving a swc lib into my library project.

But taking your advice, I would probably go the patch route rather than the plugin route since it is more intuitive to me. Exposing the right methods and properties in flowplayer and its base class should not be too hard nor should it be too bad removing the binding to stage size. That's pretty well it for what I need to do as I am not doing any real customization. I hope to put the player in a wrapper that I can dynamically manipulate on my stage another handle framework.

I'll let you know how things go. Hope not to tax you with any more questions.

ciao,
Danno

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » Flowplayer in all Flash site

Posted: Jun 26, 2010

Reply to: » » » » » » Flowplayer in all Flash site, from dannyv
Hi Danno,

The default build.xml builds the some of the plugins as well, you can remove them from the compilation by modifying the core/build.properties file and removing the path to the other build.xml files from the plugin.buildfiles property.

The CONFIG::hasSlowmMotion is a compil flag that tells the Controls plugin whether it should use the slow motion buttons or not.

Good luck and let me know how it goes :)
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » Flowplayer in all Flash site

Posted: Jun 28, 2010

Reply to: » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
So, I was successful in part one of my journey, that is , to create a FlowPlayerLibrary.swc which can be added to a flex project and used to add a flex flowplayer component to a project.

I created a flex library project, then captured just about every class from the core, common, controls repositories (within the free, builtin and commercial sub packages), then rearranged them into a contiguous package structure, and then tracked down those other references that the compiler complained about in the fla/swf/swc libraries inside the various lib directories throughout the projects.

Still lots of compiler complaints from all the compiler flags throughout the project which were satisfied with the build xml file in an ant build but I had to add them as compiler options in a large ungainly compiler argument. (probably a better way to do this but I am inexperienced at special building within flex). My compiler arg was something like this:
-locale en_US -define=CONFIG::hasSlowMotion,false -define=CONFIG::debug,false -define=CONFIG::skin,false -define=CONFIG::commercialVersion,false -define=CONFIG::versionStatus,"'dev'" -define=CONFIG::version1,3 -define=CONFIG::version2,2 -define=CONFIG::version3,3 -define=CONFIG::audioVersion,'3.2.0' -define=CONFIG::controlsVersion,'3.2.1' -define=CONFIG::freeVersion,true

Then, voila, the thing built and I had my library. Unfortunately, I think that was the easy part.

I would have thought that once I had the library, I could just add a flowplayer component to my project, constructing it with the minimum parameters and having the contstructor handle the defaults:
- I want to pass it a controller reference to supply the controls
- I want to pass it a url pointing to a media source (or a playlist of sources)
- I want to set its size to meet my layout requirements

everything else should be defaulting to a default configuration (colour, background, border, skins...)

No such luck on that constructor. Here is what the constructor looks like:


		public function Flowplayer(
			stage:Stage, 
			pluginRegistry:PluginRegistry, 
			panel:Panel, 
			animationEngine:AnimationEngine, 
			canvas:StyleableSprite, 
			errorHandler:ErrorHandler, 
			config:Config, 
			playerSWFBaseURl:String) {
				
			super(stage, pluginRegistry, panel, animationEngine, errorHandler, config, playerSWFBaseURl);
			_canvas = canvas;
		}

None of the parameters default. The API has no information about the meaning of any of these parameters. So to construct a flowplayer, the flex developer must first construct a plugin directory, an animation engine, a styleableSprite canvas, an ErrorHandler, a Config object.

I started doing this but got hung up mostly on the Config object. The Config object has some of the stuff I wanted to see in the flowplayer constructor (controlsVersion some config stuff) but the most confusing thing for me was that it included the playerSwfUrl which is used by the PluginBuilder as some sort of self-referernence to....to.....to build the plugin that this Config object is already part of??? And the PluginBuilder seems almost a super of the Config object, but doesn't seem to use the playerSwfURL for anything.

So I'm blocked there - the question is how deep do I want to delve to figure out how to make the most simple construction of a flowplayer video player. The worst thing is that there is no documentation from the standpoint of a developer trying to change or extend the player. I'm guessing at a lot of stuff and likely making bad guesses for the mostpart.

From Thomas' description of the linkage of the size to the stage, I think that is would be easy to break that linkage and link its size to the container I put the player in.

However, if I continue, I will create an orphan that is difficult to benefit from continued development on the flowplayer because of the lengthy process I just described to get it into the flex world. But the worst part is that the only way for me to progress is to read code and try to figure out what's going on.

To end this with a question, I guess it would be....Is there some work going on in flowplayer to provide documentation for understanding (and extending) this thing? At this point, as I mentioned, I am not looking to extend the feature set at this point, just to make this thing usable in a flex/flash application.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » » Flowplayer in all Flash site

Posted: Jun 28, 2010

Reply to: » » » » » » » » Flowplayer in all Flash site, from dannyv
Hi Danno,

Welcome on the looong road of embedding FP :)
I guess you could copy/paste the Launcher class and use that class as starting point. It handles the plugins creation, error handling, etc, etc (there are the initPhase1, initPhase2, ... methods).

Unfortunately you will indeed need to create an orphan 'cause there's much to change in the code to do a Flex component (imho). The easiest way to go is to load FP as an external swf (like I did) 'cause you won't have to bother about compilation, config, initialization, etc, etc, etc...

As far as I know, no documentation plans about that :(
Cheers,
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » » » Flowplayer in all Flash site

Posted: Jun 29, 2010

Reply to: » » » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
Thomas,

I tried your static config launcher class from earlier in this thread. I'm getting an error in the preloader initialize() method where it dynamically loads the org.flowplayer.view.Launcher. (in the getAppClass() method)

error instantiating Launcher TypeError: Error #1007: Instantiation attempted on a non-constructor.: Error #1007: Instantiation attempted on a non-constructor.

The only difference from what you have there is that I had no idea what you were doing with the waitforplayer() call. Normally, I listen for the complete event on a load to call the handler since waiting is usually not feasible. But you are doing something funky there with the progressEvents and the unknown waitforplayer() call. I do notice that the initialize does not run until the preloader is added to the stage.

Perhaps my error is related to that difference, but from the error, it appears its not constructing the launcher properly. I can't debug because I'm using the flowplayer-3.2.2.swf and just researching the error generated in the preloader code in my "parallel" source.

Does your example work with later versions of the flowplayer swf? Only other diff is that I'm using the Flex 3.5 SDK.

And on your Launcher class suggestion, yes, that is a possibility. I don't really understand the whole Preloader/Launcher purpose in life here but again, that goes to lack of documentation. My time might best be served taking a look at JW Player or some flash-centric player rather than paddling against the current any further.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » » » » Flowplayer in all Flash site

Posted: Jun 29, 2010

Reply to: » » » » » » » » » » Flowplayer in all Flash site, from dannyv
Hi Danno,

I must admit I did not try with the latest 3.2. I know Anssi played a bit with the loading, maybe that's why it doesn't work anymore.

The waitForPlayer function was just querying a static property of a simple FP plugin (only way to get the Flowplayer instance without hacking too much the code). You can ignore that if you don't need to access the API.

The fake event was there to trigger some internals of the Preloader class and get rid of a race condition and get the player to load.

I understand your frustration :) I guess you need this done ASAP, but I'm not sure I'll have the time to implement the wrapper before a couple of weeks. I'm pretty sure it would take way more than one day to develop that kind of wrapper. Already did it once as custom dev for a company and it was quite tricky.

There's no extra documentation, only the code can you get started. As far as I'm concerned, I prefer having access to the code instead of an outdated doc ;)

Anyway, I'll try to work on that when I have a chance.

Cheers,
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » » » » » Flowplayer in all Flash site

Posted: Jun 29, 2010

Reply to: » » » » » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
It's not as much time urgency for me as just looking at the long term viability. I have a contract coming up where I need to incorporate a media player to a flex/flash client, and I have a product I am developing for my company where I need a media player. Neither I, nor anyone (especially Steve Jobs), can predict the future, so it's always nice to have extensibility. For my product, I wanted consistency between an existing youtube chromeless player and the generic media player which could be accomplished with a common control component, but that seems unlikely at this point.

I was looking for something easy to integrate quickly with basic functionality and extensibility. I'm not criticizing flowplayer but I think the designers came at it from opposite direction as I would have, being a flex developer.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » » » » » » Flowplayer in all Flash site

Posted: Jun 29, 2010

Reply to: » » » » » » » » » » » » Flowplayer in all Flash site, from dannyv
Indeed, Flowplayer is not really meant for a Flex dev, more for a web/js dev.

I totally agree that, as of today, it's painful to integrate FP into Flash. However, this is still totally feasible and you can keep the Youtube-like APIs.

I'll discuss with Anssi how this can be improved and keep you updated.

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » » » » » » » Flowplayer in all Flash site

Posted: Jun 29, 2010

Reply to: » » » » » » » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
thanks Thomas, I'll stay tuned to this forum.

sgenevay

Posts: 3

Registered:
Jun 25, 2010

» » » » Flowplayer in all Flash site

Posted: Jun 28, 2010

Reply to: » » » Flowplayer in all Flash site, from blaaaaaaah
wellll .. all that looks unfortunately like chinese to me ... why flowplayer guys didn't simply gave a fla code that we could copy and past in our project ? i will never go as far as u are now i guess....

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » Flowplayer in all Flash site

Posted: Jun 29, 2010

Reply to: » » » » Flowplayer in all Flash site, from sgenevay
Yes, I think a flowplayer internal guru could probably spend barely a day putting together a flash only project, linked branched from their source tree that would enable your everyday flex/flash guy to build and embed, size, skin the player.

I don't think they are serious about encouraging open source community effort except possibly for a few special partners, who may have access to some documentation or may have been early contributors - I don't know. From looking at the code, they were flash CS4 guys rather than flex guys. Bummer that it took my weekend just to figure out that its not viable :-(

burn

Posts: 2

Registered:
Jul 6, 2010

» » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » Flowplayer in all Flash site, from blaaaaaaah
Hi all, I'm almost new to flowplayer and I need to embed this in a Flash CS4 project.
I've tried your solution and works well, thanks.
But now I have to remove the pause functionality when the user click on the screen, because of our video is a live stream.
Searching around I've found many reference to onBeforePause, which works in JS but it's ignored when the FP is loaded in Flash stage.
By now I have added the FP swc to the compiler and I've tried something like this:

function delayedActions(e:Event):void
{
	try
	{
		DisplayObjectContainer(VideoManager).getChildAt(0).width = 705;
		DisplayObjectContainer(VideoManager).getChildAt(0).height = 579;
		var fp:Flowplayer = DisplayObjectContainer(VideoManager).getChildAt(0) as Flowplayer;
		//fp.playlist.onBeforePause( something like: return false);
	}
	catch(e:Error)
	{
		// Try later
		var delayTimer:Timer = new Timer(200, 1);
		delayTimer.addEventListener(TimerEvent.TIMER_COMPLETE, delayedActions);
		delayTimer.start();
	}
}

But the line


var fp:Flowplayer = DisplayObjectContainer(VideoManager).getChildAt(0) as Flowplayer;
Rise an "Error #1007: Instantiation attempted on a non-constructor"

Can anybody give me a hint on how to prevent the pause?

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » » Flowplayer in all Flash site, from burn
Hi,

You can't get the Flowplayer instance that way. The most easy thing to do, imho, is simply add a Sprite over the playing area that stopImmediatePropagation and preventDefault on mouse click. Flowplayer won't get the click and so it won't pause :)

Cheers,
Thomas

burn

Posts: 2

Registered:
Jul 6, 2010

» » » » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » » » Flowplayer in all Flash site, from blaaaaaaah
Funny... trying to do "the best way", I don't thought at this "patch".
Thanks a lot.

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » » » Flowplayer in all Flash site, from blaaaaaaah
Wow, that's a hack if I ever saw one ;-)

I have been able to create a working Adobe AIR FlowPlayer, that I can drag, size etc.

The biggest issue I had was the assumption that the "stage" was the source of all positioning and sizing. I passed a flex canvas container to the launcher and downstream so I could use its sizing to drive the clip resize. (generated resize event on the canvas and the resize handler automagically sized it).

I really only added a preloader object to my flex/AIR application container and it creates launcher, panel, screen etc.

I did add some setters/getters in the launcher to expose the player, player config and controls config objects to the application. This might be an approach you could take to get at the player or controls config. (I added a reference to the controls plugin by waiting in the onPluginLoad method in Launcher and once the controls plugin was loaded I gave it a reference and exposed it with a getter)

Seems to me that if you have the controls object, you can disable the pause button which may be a cleaner approach.

I have a question though. I have a means to add a video source URL through injectedConfig or directly on the config object. What do I need to do to get the player to load and play the new injected clip reference?

And on reflection from some earlier discussion, I think the best way to go forward with flex based modifications would be to create an Ant script that pulls together the necessary source from the three or four projects, compiles together. I would likely go with source librarys in my overarching Flex project since its a pain building, moving the swc into a second project as a lib and then running, at least given the large number of changes that would be required.

Anyway, it wasn't quite as difficult to get it going as I thought. It did take a while to figure out the layout hierarchy....preloader, launcher, panel, screen, clip, marginlayout....documentation there would have helped.

Still some quirks like the placement of the playAgain overlay when I resize after video completion.

If anyone can tell me how to reload the new injectedConfig, that'd be great.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » » » » Flowplayer in all Flash site, from dannyv
Hi Danno,

Congratulations :) The injectedConfig is only read at load time. If you want to play a new clip, you need to call the play() method on the Flowplayer class (and thus you have to get a reference to the player).

About the playAgain button, try calling player.reset('play') or something like this.

Cheers,
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
thanks Thomas,
still experiencing problems.

My demo first loads the clip using the injectectedConfig with a JSON string.

But my Flex/AIR app has a textbox to paste in a URL. So the default clip loads and plays when I run my Demo App but then I want to load and play another clip. In this case, I have a reference to the player and the player Config object. I tried setting the clip, then calling play() but it did not load the new clip (default one was still there).

I tried the reset call but it doesn't accept "play" as an argument - it is meant to reset the plugin properties from what I read.

And I haven't contructed a clip, all I have is the string url. The real clip has some "amorphous" clipObj object which is never easy to figure out if you're not the inventor.

So I still can't figure out the basic "load and play this flv" which should be one of the most basic use cases.

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » » » Flowplayer in all Flash site, from dannyv
It's usually a good sign when I'm replying to my own posts....self help.

So I've got the loading-from-url-in-text-box working. I constructed the minimal clipObj which turned out to be only the {url: "yadayada.flv"}

It has dawned on me that when this thing is in an AIR app or flex app that it suddenly is percieved more like a desktop player which you want to play anything (rather than just the prepared streamable videos on the site you would embed the player on if you were deploying this in the traditional way).

I pasted in a number of video urls from third party sites and most failed and these were sites that probably posted the video for download rather than streaming. It is not really obvious from a site's presentation whether or not a video link will provide a streaming video rather than just a download. So, to keep that ugly detail from the user, the player would have to react to non streamable media. If it could download, then play the start of play would be delayed by the entire download time. I guess this is a consequence of not controlling the media to be played on the player.

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » Flowplayer in all Flash site

Posted: Jul 6, 2010

Reply to: » » » » Flowplayer in all Flash site, from burn
I'm working in Flex, not CS4, but I just tried commenting out the line in the Controls.as createChildren method - there is one that adds the _playButton child. This prevents the user from pausing the video since the button doesn't show up on the video controls. The user could still click on the scrubber to play at an earlier point but that could likely be disabled. (You could as easily remove the scrubber but user likes to see progress. But you could null the "onScrubbed" method.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » Flowplayer in all Flash site, from dannyv
Hi Danno,

The reset methods takes an array of plugin names if my memory is good. The play again button is only a plugin.

Not sure I understand your issue about videos that fails ?

About the onBeforePause, yes this is a nice ugly hack :)
The good way of doing it would be using something like this :

_player.playlist.commonClip.onBeforePause(function(event:ClipEvent):void { event.preventDefault(); });

but you need a reference to the player. You can either modify flowplayer-core to get access to the player from your AS/Flex app or create a plugin that only does that and load the plugin through the injectedConfig.

To me the most efficient solution is still the dirty hack, in that particular case.

Cheers,
Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » Flowplayer in all Flash site, from blaaaaaaah
Hello again Thomas,

You are very right that sometimes the easiest solution falls into the "hack" category. I've used many in my day. You have to worry a bit about consequential bugs, in the example you describe, maybe worry about sizing issues.

My comment about videos failing results from me testing a bunch of sample videos posted on the web.

Here is one such site:http://www.stockshots.com/SampleFootage.htm

I get flowplayer error: 200, stream not found, netstream.... on most. I rightly or wrongly attribute it to improper support for streaming of that video type on the web host. I haven't done extensive testing, but one of the flowplayer forums that discuss this error
http://flowplayer.org/forum/1/34149
which leads me to believe that the problems is on the server side support, either streaming protocol or MIME settings.

My point about the different model of use is that if I follow traditional Flowplayer user pattern, provide website, provide page that embeds flowplayer in my browser flash runtime, provide specific media on that site with proper streaming and MIME setup, then all is well.

However, my model is different. I have an AIR app on desktop or a Flex app in browser flash runtime, but my application allows for users to drag or paste video links into a flex control and then they are loaded and played. I have no control over the host server that publishes the media and whether it is properly setup for streaming versus download. Just from playing around last night, it seems that the majority of samples I looked at cause a stream error. It works great for the flowplayer samples and some others I've found but many fail. For my application I might need to move a non supported media to AmazonS3 or another host to successfully stream it. Obviously I need to do a bit of testing to figure out exactly what's going on. I admit I was a little surprised to see this issue, but I have no experience with media streaming so I'm not shocked.

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » » Flowplayer in all Flash site, from dannyv
Hey Danno,

Flash can only read FLV containers, or some MP4 with H264, not surprised you can't read your mov or rm files.

Maybe that's the issue ;)

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
there are some fails on flv's as well but I don't really understand your comment about flash restrictions.

Is not the flowplayer in a flash runtime in the normal case, yet it plays avi and mpg media? The flash internal video components only support native flv but flowplayer is handling the coding/decoding of the supported media types, no? I can open a flash socket and send/receive anything coming down the pipe as long as I know what to do with it.

Now I am quite confused ;-(

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » » » » Flowplayer in all Flash site, from dannyv
Flowplayer uses the native Video/NetStream/NetConnection combo of Flash to display videos.

I'm no even sure you can download and decode video yourself and pass it to the frame buffer/screen etc. I'm pretty sure you can't actually, at least with the classical Flash runtime. Don't know about Air possibilities.

You can open a stream connection, get the bytes but you will have to do the decode, demux yourself, and I'm pretty sure you won't be able to access the display at a sufficient low level to display the decoded video and play the sound.

Thomas

Danno

Posts: 19

Registered:
Jun 24, 2010

» » » » » » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » » » » » Flowplayer in all Flash site, from blaaaaaaah
so how does FP play avi's, mov's, mpg's?

ah, I guess I should read everything.

So fp setup converts everything for publishing....?

okay, I was definitely on the wrong track.....

Thomas Dubois
thomas_at_bigsool.com

Posts: 68

Registered:
Feb 1, 2010

» » » » » » » » » » » » Flowplayer in all Flash site

Posted: Jul 7, 2010

Reply to: » » » » » » » » » » » Flowplayer in all Flash site, from dannyv
Yes, using the Setup Tool and uploading a video, the video is automatically converted to FLV and put on a CDN.

Sorry to read you were on a wrong track, especially after all the work done !

Anyway, good job you did and let me know if you manage to play other videos with your Air app.