How to play flash files in webview of native android app - android

I am trying to render a webview inside native android app.
My webview consists of many flash files(having ".swf" extention).
The flash plugin is not initialized and a black screen appears.
Is there any way to enable flashplayer or any additional player which will solve my problem.
Note: Please don't suggest to convert flash files to html5 supported format. Also, the files plays well in dolphin browser.

Related

Videos not loading in flash CS6 published to android and iOS

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.

Cannot play flash in android web view after many try

I am doing an android app which shows my website in the webview. My website contains a flash player for playing movie.
Here is the link which contains the flash player and I want to display on the webview.
After reading many articles, I have tried the following code:
webview2.getSettings().setPluginsEnabled(true);
webview2.getSettings().setPluginState(PluginState.ON);
webview2.getSettings().setJavaScriptEnabled(true);
webview2.getSettings().setAllowFileAccess(true);
But it is still not working.
This may sound very simple, but make sure the platform you're testing this on has the Flash Player installed.
Many android phones do not have flash player in their browsers anymore, and there isnt a flash player plugin for the WebView object.
Your best chance would be to make this video in your page viewed with html5 video tags, or let people view your website in their own browser, which may or may not work (some browsers have flash, some dont)

Playing wav files in the Android browser

Using the html 5 audio tag it appears it is possible to play back an mp3 through the android browser. Is it possible to do it using a wav file? If not through the audio tag is there another way to do it?
The HTML5 <audio> tag supports WAV files. Depending on your version of Android, though, it might not work in the native browser. For example, no format worked in Android 2.2. I tried it on my own phone, the Galaxy Nexus with Jelly Bean using the excellent test on Are We Playing Yet?, and found that it was not supported.
The other way to do it is to transcode your WAV file to a different format and use HTML5 audio. The Flash based WavPlayer might work too, but please remember that Flash was discontinued for Android and is not guaranteed to be installed on all devices.
android version 2.2's native browser supports ".wav" file. but android 4.0's native browser does not support ".wav" file.

How can I let the Android 2.2 browser just stream the video instead of downloading the video from html?

I'm running into a funny problem. I have a html file where a video is embedded. When I'm launching this html from my mobile with Android 2.3, it just streams fine, I can see whole video from the android browser. But when I try to do the same from my other android with 2.2 version, it tries to download the video instead of steaming.
How can I let the Android 2.2 browser just stream the video instead of downloading the video from html?
The media player in the html file used is JW player, and the html file with video is hosted on bitsontherun website.
Any help is greatly appreciated.
The android 2.2 phone probably doesn't understand the plugin (jw player is a flash video player if memory serves).
Does the 2.2. phone have the flash pluing installed and set to use? In the webview make sure it is allowed to use the plugins as well:
webView.getSettings().setPluginsEnabled(true);

Android WebView - Flash swf plays, can hear audio, but screen is blank

I am trying to display local flash swfs in the WebView. I have WebView set up and it will happily display local HTML files, but when I try to display Flash, the screen is blank. The flash file is running as I can hear the audio.
Any ideas, or is this just a known issue / bug? I have noticed that most swf players from the android market suffer the same issue.
Thanks,
Jon
In the manifest files set:
Set android:hardwareAccelerated="true"
Source:
Flash video not displaying in WebView for Android 3.0.1

Categories

Resources