Some developers asked me, if it is easy to get dailymotion flv URL? I thought, I would post how to do that.
If you know the dailymotion video-id, believe me it's very simple to do that. In case, you don't know how to get dailymotion video-id? Let me give you some hints, highlighted text is the video-id:-
Once you have video-id, you can use the following php-script (dailymotion.php.txt) to do either of two things:-
</code> Let me tell you, you can do the entire thing on client-side without using any server-side script, though logic remains same. Look at this post and learn what technique to use :-). Another hint, if you are consuming dailymotion rss-feed(s), you don't need any php script to construct flv-url, you can just replace "80x40" text by "320x240" in media:content url. As always, please look at the code, change, optimize and fix it to meet your requirements. I wrote it in ten minutes and just as a proof-of-concept, this is no way the best method and php-code can be much better.
// Above invocation would return:-
Let me tell you, you can do the entire thing on client-side without using any server-side script, though logic remains same. Look at this post and learn what technique to use :-). Another hint, if you are consuming dailymotion rss-feed(s), you don't need any php script to construct flv-url, you can just replace "80x40" text by "320x240" in media:content url.
As always, please look at the code, change, optimize and fix it to meet your requirements. I wrote it in ten minutes and just as a proof-of-concept, this is no way the best method and php-code can be much better.
Let me clear some points here, as3httpclientlib is not as3httpclient. The as3httpclient, let's call it my-project in rest of the post, was a better version of HTTPURLLoader. HTTPURLLoader was a proof-of-concept work to deal with various limitations in Flash Player APIs.
my-project doesn't have cleaner api and it also lacks various thing, honestly speaking, I could never spend enough time to make it better. Thanks to Erik (aka eecolor) for refactoring HTTPURLLoader and adding more features.
I was planning to add TLS support, after I heard about Metal Hurlant's work on TLS. Now, I am not planning to do any further work on my-project (as3httpclient) except cleaning the code a bit for those who are already using it.
I find, as3httpclientlib (Gabe's project) is much better and very complete. I spent sometime looking at the code base, it's api reminds me of jakarta-commons-httpclient, which I always liked for it's simplicity. With as3httpclientlib, you can do pretty much everything (DELETE, GET, HEAD, POST, PUT - http-methods, multipart uploads etc) you were able to do with my-project (as3httpclient).
If you have been using my-project (as3httpclient), I suggest you to look at as3httpclientlib.
As we know, Flash Player Socket API has some security-restrictions, so any socket based http-client would work for AIR projects but not for Flex projects, unless you can afford special-setup on your server to serve special policy-file required for socket-connection to any port below 1024. Gabe has developed as3httpclientlib library for AIR based projects, however, I am sure it can be used in Flex projects as long as server is setup (as mentioned above in this paragraph).
Check out various examples/tests in as3httpclientlib project, you would find things like amazon-s3-tests, upload-tests etc
Thanks for reading a post full of similar names - as3httpclient and as3httpclientlib :-)
Adobe Flex framework has God Objects, UIComponent is one those. I am not sure, if there is something called God methods, but there are some methods which either do/assume more. Manish's post shows one such case and you can figure out more by looking at the code ;-)
Flex 4 is going to be better.
While talking to Arul about various limitations (a few HTTP methods/verbs supported) in Adobe Flash Player's HTTP APIs (URLLoader/URLStream etc) and my previous posts, he suggested me to look at Silverlight, what kind of support it has got?
I don't know, if I can develop Silverlight applications on MacOSX, I would figure out a way using Mono/DotGNU later? But for now, I searched MSDN and quite surprised to see it does support more HTTP methods (DELETE, GET, POST, PUT), at-least in some Silverlight Streaming HTTP package? That means, it's easier to deal with REST web-services.
Thanks to Arul for giving this idea, I am going to spend sometime playing with Silverlight and try to compare the both Adobe Flash and Silverlight platforms, I am sure that way I can file more enhancement requests for Adobe Flash Player to make it better platform, yup! I love it and want it to be better and better over the time.
A couple of months back, my manager sent us a video-link - "Discipline in Thought" by Dijkstra. After watching video, I thanked my manager for sharing the link. I noticed, next two part of series are now available, I thought of sharing it with you all.
It's worth spending sometime to watch these videos:-
Many of us would disagree on some points in the video, one of them is about not using iterative-development or ship complete product instead of dot releases etc. I am going to think about it and probably post my views in upcoming post (s), I have something to write about Apple and MS, kind of related to some points in the first video.
This is for Adobe Flash Player team, specially security guys, please allow us (developers) to use Socket API in creative ways, beyond you permit us. Atleast, for same-origin (domain), we don't need to have special policy file to allow socket-connection over http-port (80) or ssl-port (443)? This is totally doable?
Please, please tell us why don't you let us do it now?
Query-string in SWF URL is bad idea because swf would be downloaded again by browser/client instead of being loaded from browser-cache, it happens if URL becomes non-unique due to the presence of changing query-string in different requests.
Browser does cache data for all URL, unless HTTP response headers (for URL or other resources) instruct not to do caching. If URL is different, browser considers it a new requests and downloads the data again instead of consuming from cache.
We can try to avoid or optimize such cases. In past, developers have used the other way by having random (non-unique) query-string in SWF or XML/asset URL to force reloading of asset/resource instead of using the ones from browser-cache. Though, they could have done things by setting right HTTP headers.
I have noticed some websites where swf URL has a query-string i.e. http://yoursite.com/yourapp.swf?var1=somedata, where value of var1 is not constant rather changes? Obvious reason, I want to pass dynamic data most of time hence using query-string instead of hard-coding it in swf itself.
I also noticed some sites which are using SWFObject and still passing data via query-string instead of flashvars using addVariable (..) instance method of SWFObject.
Another place, I again noticed something similar, AVM+ application loads AVM- (SWF 8 or less) application, let's call it legacy-swf, and passes data via query-string, ok, that is understood there is no other way except writing a light-weight wrapper that uses LocalConnection or query-string approach?
This is very basic thing in web-application development, user-experience can be improved by doing these little things. I hope to write some more observations, no matter how stupid/trivial it sounds to me or other programmers. It's good to post these things in context of flash/flex so beginners, who are not familiar with details of HTTP or other standards, can learn.
It's nice to see more developers from India are blogging and sharing their knowledge with everyone. There are ( and always have been) very smart and cool developers in India but generally they maintain a low-profile or too busy with work or shy.
Check out the following list, I have used the names of bloggers instead of blog-title because it was for me to do so.
You can bookmark this link.
He is still working on it, however, he has posted a demo and current version of code. I am sure, this would be pretty useful. I remember of reading a thread on flexcoders about creating mock-objects in ActionScript 3.0, eval-project might prove useful there.