I am planning to port a flash player to Android OS. Presently Android is not supporting the Flash. I have looked into GNash, an open source flash player but the problem with this is that it is not supporting the latest version flash files and we can't open the youtube with GNash.
Are there any open source light-weight flash players which can be ported to Android.
EDIT: I have also tried SwfDec but even this one is not playing the videos from youtube.
Any other open source players which can play youtube videos?
Of course this could be a fun project to hack; however, you'll soon face real competition from Adobe, who are porting their own player as we speak:
http://www.google.se/search?q=flash+android
Just in case you can afford to wait.
I have used ffmpeg to convert the flv to mp4.
According to Google/OHA member engineers the problem you will have is performance on current device hardware specifically G1s..
My impression is that you will not see flash until the Dalvik VM JIT is finished developmentally...probably not until SDK 3.5 probably..
GNash website states (and my own experience confirms) that GNash actually plays most youtube videos OK. See GNash wiki.
Now Android has flash support,
maybe this can help:
http://www.synesthesia.it/playing-flash-flv-videos-in-android-applications
playing FLV on Android using flash player inside a webview
Related
=== BACKGROUND SUMMARY===
At this moment, we are using Android VideoView to perform video play black. Everything seems to be working great until we encounter Live Streaming.
VideoView tends to have 10-15 seconds delay from the live stream within a local network (LAN).
While attempting to solve this issue, we came across VLC Embed for Android. After searching on the Internet, it seems there isn't any article compare pros and cons of using Android VLC Embed vs. Android VideoView.
=== QUESTION ===
What's the advantage (pros) and disadvantage (cons) of using Android
VLC Embed vs. Android VideoView?
Is VLC Embed stable?
Anything I should be careful when switching existing VideoView to VLC?
Thank you all in advanced
My view may not be very professional but it's about what I've experienced so far.
First, Android VideoView is good since it comes with the Android SDK so it does not require external library. But this one has some limits. For example, as far as I know, it doesn't support MMS and MMSH protocols and some others I didn't quote. Which is not the case for Android VLC SDK. This library is complete and supports almost all media formats I know so far.
It just increases your apk on size, on my side that's the only disadvantage.
Is the Android VLC SDK stable? Yes it's stable and maintained by a huge community.
Anything I should be careful when switching existing VideoView to VLC?
You should keep your sources same and care about aspect ratio.
What's the advantage (pros) and disadvantage (cons) of using Android VLC Embed vs. Android VideoView?
Advantageļ¼
More features. VLC supports almost all media formats, hardware decoding. audio tracks, subtitles, chapter are also supported.
More integrated, simpler logic. You can easily get media information and cache them. The playback engine will proactively notify state changes and events, just register player event listening.
Disadvantage:
APK file size increas. If both arm64-v8a and armeabi-v7a are supported, it will increase more than 30MB.
Multiple instances are not perfect. For example, playing 2 videos at the same time is a hassle.
Is VLC Embed stable?
Stable. Starting with VLC 2.0.x (now 3.0.x), I use the VLC library in my Android App. It runs steadily from Android 5.1 to Android 8.0. A small number of 4k h265 video playback is not normal, but can be resolved by displaying "Can not play".
Anything I should be careful when switching existing VideoView to VLC?
To use LibVLC on Android The Medialibrary(org.videolan.medialibrary) is also required. You also need to note the licenses.
VLC for Android is licensed under GPLv3
This may be a concern for you if your project uses a different license.
I have one issue while using android ExoPlayer for streaming url.
Here I have attached sample URL:
http://epicmediaservice.streaming.mediaservices.windows.net/0bd4f655-00f9-4e36-a638-f8e90d9432c9/Nursery%20Rhymes%20Sample%20Clip.ism
It is working in some device, but not not working for Android version 4.2.1 (Micromax canvas 116)
It shows buffering video, but not playing.
If I select video option as OFF then it plays, but only audio comes no pictures visible.
new Sample("Super speed (PlayReady)",
"http://epicmediaservice.streaming.mediaservices.windows.net/0bd4f655-00f9-4e36-a638-f8e90d9432c9/Nursery%20Rhymes%20Sample%20Clip.ism",
DemoUtil.TYPE_SS),
Looks like you are trying to play DRM-protected content (PlayReady) which probably won't work since Exoplayer doesn't support DRM until Android 4.3 and upwards, also check on your device's documentation that it really supports PlayReady.
Check section Digital Rights Management on ExoPlayer's developer guide.
I'm new to flash so I will try to write it down as clear as i can. I hope you can help me with this and thanks in advance.
I have a project that function like a brochure. Its just a compilation images, text and several videos with a very simple goto pages functions.
the images and text are already included in the fla file while the videos are in my project file directory and streamed from my local hard drive. I'm using the earlier version of flash video component and I'm using flash CS6.
My AS3 Script to load the videos
sp.source = SPContent;
sp.setSize(340, 335);
var VidBtn01 = MovieClip(sp.content).VidBtn01;
var VidBtn02 = MovieClip(sp.content).VidBtn02;
VidBtn01.addEventListener(MouseEvent.CLICK, onClick01);
VidBtn02.addEventListener(MouseEvent.CLICK, onClick02);
UNOVid.addEventListener(Event.REMOVED_FROM_STAGE, stopMovie);
function stopMovie(e:Event=null)
{
UNOVid.stop();
}
function onClick01(evt:MouseEvent):void {
UNOVid.source = "Video1.flv";
}
VidBtn01.addEventListener(MouseEvent.CLICK, onClick01);
function onClick02(evt:MouseEvent):void {
UNOVid.source = "Video2.flv";
}
VidBtn02.addEventListener(MouseEvent.CLICK, onClick02);
When test published in flash professional, the projects works really well. When Publishing for android and iOS, flash do not reveal any errors. Upon
testing the published apk and api files, then the problem arise.
Problem 1 Android: All buttons and navigation working, flash video component present but some videos canot be played.
Problem 2 iOS: All buttons and navigation working, videos not playing, cant really tell because flash video component is not being displayed.
All videos are flv 320x240 but of different duration and encoded using flash video encoder same settings. During packaging files included are the
projects swf, the flash video component's swf, the app.xml and all the videos included in the project. The .apk and .api file size is 1.02GB. I also tried
publishing without the videos just to see the file size and both the .apk and .api file is only 3.9mb. Also check the videos folder size in windows
properties, size is 1gb plus.
I checked the installed app on my iOS device using an app called iFile from cydia, all the videos are accounted for with the flash component.
For android upon checking the installed file it revealed and apk file and some .so file. You cant really see if the files are all in there. So I did a little
research and learned that if you change the .apk extension to .rar, you can extract the file in windows to inspect whats inside your published .apk
file. Upon doing sa I was able to see that all the files are accounted for.
I'm using for device testing a generic android tablet running 4.01 IceCreamSandwich and an iPad Air iOS7 jail broken.
My Question for ANDROID
How does android process the apk file, why was the apk files not extracted when installed on my device?
What might be the reason why some of the videos cannot be played? Hardware Limitation perhaps, any idea?
Will there be a conflict with the New Versions of Android (jellybean/Kitkat) since adobe flash already stopped supporting android?
My Question for iOS
Why was the Flash Video Component missing? Is this a compatibility issue with iOS since the flash video component is an swf file?
I assumed that packaging it would eliminate that issue considering that publishing air for ios includes adobe air in the package. If that's the case isthere another way to deliver the video on stage in iOS?
Is FLV video compatible with iOS if not what video compression should i use?
Lastly how can i publish to Android and iOS without the need to package it with the video. So the final .apk and .api file size is manageable.
Perhaps just adding the videos in a directory within he device's storage using the resolve path method. Can anyone share how i can do this?
Again thanks in advance to all.
I don't have time for a complete answer right now. Here's a partial answer:
You can't use .flv on iOS. You have to encode using the H.264 codec in an .mp4 file. Apple has more-or-less particular specs on the encoding. Look 'em up!
Also, in iOS you'll want to use the StageVideo class combined with the Netstream and NetConnection classes. StageVideo is a requirement for the GPU video processing on iOS devices. BUT when you're running your video code on a desktop machine, or when you're running video in AIR on desktop, you want to use the regular Video Class because you'll be rendering, usually, with the CPU. So, usually, your code will have to test for the availability of GPU processing and then invoke one function for implementing THAT, or another function if only CPU processing is available.
Video (without components -- which you should forget!) sounds complicated, but it's not THAT complicated. It just takes a little time to learn. Suggestion: study here - http://gotoandlearn.com/play.php?id=46 for the basics of the Video Class. Then read the Adobe AS3 reference on StageVideo. Then come back here and ask more questions. You'll beat your head against a wall for a day or so, but then you'll really know how to handle video on, at least some mobile devices.
When you're testing on iOS don't forget to publish with GPU rendering.
I'm just learning AIR for Android myself so can't help you there.
So with StageVideo you can play a h264 .mp4 file, and by any example which I found you need to have a fallback Video component.
Problem is that I was unable to play the .mp4 video files with the Video component on a mobile device, Android or iOS.
.flv works fine, but I can't have backup video files as it takes too much space.
Is it really necessary to have the fallback to the Video component? what are the chances it will fail?
Thanks.
From my experiences (I've created 3 separate AIR VOD apps for both iOS and Android), the following is true:
StageVideo works on Android 4.0+. I was unable to get it to work with 3.x, but I have been told it works. I can, for sure, confirm that it does not work on 2.x.
StageVideo works on iOS 5+. On iOS 5, you will need to play a silent sound at startup to make sure sound works, but you should do that regardless since the iPad 2 rarely plays sound without doing that. It is a known bug in AIR that, as far as I know, has never been attempted to be fixed
iOS can only play h.264 MP4s through StageVideo and StageWebView. They will not work in Flash video players (including VideoDisplay, the base for Video and all OSMF-based players). I do not recall the exact reason for this, but I believe it has something to do with the MP4 requirement for hardware accelerated playback.
iOS can play FLV and, maybe, F4V through the Flash video players described in #3. This will lack hardware acceleration, however. That means your video and your UI will run on the same thread and share the same process. Basically, lower framerates while video is playing. Additionally, CPU decoding is a battery drain.
Android is a little more wild. You cannot use StageWebView for any playback as of Android 4.3 (have not tested on 4.4 yet). You can use Flash video players for h.264 MP4s... on some devices. I've found that they seem to work fine on Android 3.0+ on all devices I have tested. Keep in mind that is only a couple dozen out of over a thousand possibilities, though. On 2.x, it is extremely hit-or-miss. It seems to work fine on HTC and Motorola devices (which I've tested on), but I have had reports from users who cannot playback on Samsung and Sony devices.
As you mentioned, a fallback player is definitely recommended. Without having multiple sources/encode types, the fallback is useless on iOS, however. I currently have an app in the Play Store (All About Trikes) that was originally released without a fallback player and just used a StageVideo implementation. A day after release, we started getting reports that users on 2.x couldn't play videos. We had to scramble. We first released a version that couldn't be installed on 2.x and then another version that uses Flex's VideoDisplay as a fallback, which seems to have fixed the problem for those users, but I know there will be others than cannot playback video.
Long story short, there is no fool-proof way of playing back h.264 MP4s on mobile using AIR. You do want to include a fallback player, regardless of platform. Ideally, if you are streaming the video, you should have both h.264 MP4s and FLVs available with the fallback using FLVs instead of MP4s.
Hopefully that helps.
Android has a built in VideoPlayer which would seem to be the goto option, but just wondering if there might be even better open source video players for Android? This is for playing video within a commercial non-rooted android tablet.
http://code.google.com/p/dolphin-player/