Copy link to clipboard
Copied
I would like to learn more about using the iOS native video player in my Adobe Air app.
I understand that you can launch the native iOS video player by using StageWebView.
What are some of the limitations of using the native IOS player with this method?
Are there other ways to launch the iOS native player instead of using StageWebView?
Is anyone creating a Native Extension for the iOS native video player?
If you were to create an app using native iOS code instead of Adobe AIR, what can you do with the native player that you can't control using Adobe Air?
thanks!
Jack
Copy link to clipboard
Copied
Hi, Jack:
My answers are based on what I have done:
other than stageWebView, you can load native player from native UIWebview, and probably (I guess) directly open a video players.
If you do it from UIWebview, you can have the full access control of the video player, and interaction between Flex and Objective-c is also supported.
Regarding what we can do with the native player, I say we can do anything we want if it's loaded on the UIWebview.
Let's say 'pause', you can make your native player to be paused in the flex code, besides directly click the pause button. The simple workflow is:
Mapping 'pause' function to a objective-c function which triggers the native videoplayer pause function. One situation would be that you have HTML5 page only contains a video player, and java script functions to control the video (player pause, fullscreen etc).
Therefore, you can just call those javascript functions from objective-c.
You can also get information back from objective-c. Let's say you wanna do something after the video is finished, so the objective-c call javascript to listen end info of the video. then objective-c pass this information back to flex as an event. The Flex side catches this event and maps this event into Flex event for your use.
If there is a way to direcly invoke native player, those steps above will be much simpler, but I haven't tried. I am sure someone is doing that, hopefully they can answer you here.
Regards,
Matthew
Copy link to clipboard
Copied
How do you use UIWebview in AS3?
I would love to hear someone working on a Native Extension for this!!!
Copy link to clipboard
Copied
I did a UIWebview native extension because on StageWebView, users cannot free-select HTML content.
You can load lots of stuffs on the UIWebview, and the interface to call functions from Flex and pass event back to Flex is done.
Based on what I did, all you need is a HTML page with javascript functions to control the videoplayer in order to calling from objective-c.
I would like to share, and it is in my blog: http://matthewhx.blogspot.com/
I am also very curious about why you have to use the native video player? Did the video player on stageWebview give you any inconvenience?
Regards,
Matthew
Copy link to clipboard
Copied
I have not used the native video player yet. I have heard that it is difficult to control the native player using Adobe Air, so I'm just collecting info about how to best implement the player.
Copy link to clipboard
Copied
Sure, controlling native player via AIR is a little bit harder than directly using Flex videoplayer, but not that significantly.
I would go for AIR side unless there are some limitations to force to native player.
Good luck!
Copy link to clipboard
Copied
There's an Video player class utilize UIWebView in iOS. It's pretty nice if you look at the api doc. guess it might help you to embed and play video in Air mobile with iOS native video player. http://darkredz.com/introducing-ios-uiwebview-and-videoplayer-native-extension-for-air-mobile/
Copy link to clipboard
Copied
Hi lenglsh,
Can the VideoPlayer class for this extension be used to play non-fullscreen (inline) video on the iPhone? (currently, with the stageWebView method, video is fullscreen only)
Also, when using the VideoPlayer class, does the native player retain the Airplay button/functionality?
Thanks!
Copy link to clipboard
Copied
yup it's native, had Airplay button. yea from doc, you set viewPort like StageWebView, so can make inline player as well fullscreen with enterFullscreen(). See http://darkredz.com/ane/UIWebView/apidoc/
Copy link to clipboard
Copied
Okay. Sounds good!
I have learned to do some basic communication between AS3 and Javascript with the stageWebView, but I don't know anything about JSON, which you mention as being used in your extension to pass Javascript to AS3. Do your examples illustrate how to enable or use JSON?
Copy link to clipboard
Copied
There's a tutorial here http://darkredz.com/tutorial-on-uiwebview-native-extension/ in the package you will also find an example app for webview and another example for Video player.
AS3 to JS communication is as simple as passing objects around. Example below will trigger alertUserName() function in your HTML js.
var obj:Object = {username: "superadmin"};
nativeWeb.callJsFunc('alertUserName', obj);
Copy link to clipboard
Copied
Okay. I was mainly concerned with how to enable JSON. Searching around, I guess I need to import com.adobe.serialization.json.JSON;
?? I suppose if all this is in the provided examples I can figure it out...
But anyway, being able to play inline (not fullscreen) video natively on the iPhone would be a real help for my app! I look forward to checking out your Native Extension when I get back to work this week. (But I first need to do some homework on using Native Extensions)
Thanks!
Copy link to clipboard
Copied
Hey, what happened to the 20% discount offer for the first two weeks? Did you change your mind?!? (IIRC, it wasn't set to expire until next week)
Copy link to clipboard
Copied
hey gtr, the bug in shopping cart is causing Paypal IPN to failed when using discount code, buyers can't received the download link from the system. That's why I have to remove it.
Copy link to clipboard
Copied
Okay. That's a bummer.
A discount would've been nice for early adopters.