haXe Forum > Haxe for flash media player
-
JGM Mar 11 at 21:12
Hi I just want to say I'm using haxe to develop Jaris FLV Player (http://jaris.sourceforge.net) and only in a couple of hours I got a basic class done for playing videos with keyboard shortcuts, fullscreen and all the good stuff :-D
I managed to draw the player controls only coding (no need for third party tools) and I have to say haxe is a great language, great tool. To anyone wondering if they should start using haxe I would recommend it, I'm even thinking of switching from php to haxe.
I almost feel I'm programming on C++ (in my opinion) but a lot much easier and in conjunction with flash develop is a great environment for developing, i have been about a week using it with no prior knowledge of AS3 and well is really cool!
Thanks haxe guys and keep it coming ;-) -
John Plsek Mar 12 at 05:27
That's a damn sexy and versatile player you wrote ...
-
JGM Mar 12 at 19:40
Thanks ;-D!
I wanted to contribute something to the open source world still I'm adding features to it and learning haxe at the same time. -
John Plsek Mar 13 at 03:28
On suggestion - draggable volume control - I tried to add it myself, but you do controls very differently to how I made them in my early attempt at a player - I like your method better, I think, I just can't quite figure out yet how to make your volume control (and the current play position for that matter) dragable
also - can you make it display the aspect ratio (briefly or maybe within the aspect control itself) after you switch aspect ratio?
-
JGM Mar 13 at 07:41
Hey thanks for your suggestions and effort I implemented the aspect ratio indicator as a label that fades in temporarily and fades out. About the drag-able volume control I still have to work on that :D
Well the changes I made are now part of svn in case you want to check them out xD later i will publish a release
By the way i feel like I'm hi-jacking haxe forums :S in any case I have setup a forum on jaris.sourceforge.net to discuss this kind of subjects the only problem with soruceforge is that it doesn't support the mail function in case users forgot password, but well it works xD.
Well again thanks! -
looks useful, I have done some haxe video so just some suggestions..
I found that for just playing sound you don't need to attachNetStream....(line:249) line _video.attachNetStream(_stream); and some of the resize code may need adjusting... it is useful for the player to be used for playing acc as well as video? Maybe it does already..
I also make the player a singleton since you rarely want to play two videos at the same time and it can be easy for code to create the same player twice and do some checks on netStream to make sure it exists when you think it does, and make sure you close it as its easy to leave one open and loose access to it.. ( modify line 243 )
// to try and limit streams to only one if( _ns != null ) { _ns.close(); _ns = null; } _stream = new NetStream(_connection); //...
i think you maybe closing it else where but you don't need to close it to just restart play if that's what your doing....sorry not sure I only looked through code briefly so just guessing.In terms of events I would consider moving to HSL when its done rather than eventdispatcher, its possible to create a much lighter player, I would consider maybe compositing or extends a light version so users can use a light one without much controls if that's all they need, I mean this seems to have bells and wistles you would not always need... I can send you some minimal code if it helps.
-
JGM Mar 13 at 20:41
Thanks for your observations!
About line 249 I forgot to add if(_type == InputType.VIDEO) so thanks for pointing that also I wasn't sure xD.
About the resizing code I'm really bad at it any suggestions?
And the netstream is being closed at the load function before taking any action
HSL, is that an haxe events library?
About a lighter player, well I want to implement some kind of plugin interface where you can choose the controls to use also with flash vars could be possible to disable contextmenu entries and other kind of things, I have tried to develop the player class detached from controls code as possible, the only thing I have to remove from player class is the _poster since the player hides the poster when starts playing so make that inside the poster class and not inside the player class since there are the neccesary events on the player class to accomplish it.
Also is possible to disable controls by removing the object initialization of controls on Main class and control the player only with keyboard shortcuts. Made that thinking on future javascript remoting, to generate html/CSS/JS controls. -
Andy Li Mar 14 at 14:46
html/CSS/JS controls will be really nice. Extremely useful if you support HTML5 video too!
-
JGM Mar 14 at 19:24
After I implement a playlist I will work on that :) first I need to learn how to interact between flash and javascript