Skip to main content
Inspiring
April 20, 2012
Question

Using the native iOS video player?

  • April 20, 2012
  • 1 reply
  • 13507 views

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?

  • Can I not limit the user's control of the playback controls so the user cannot fastforward thru an ad video?
  • Once the video is done, can I auto start to a new video?
  • When the user clicks the DONE/BACK button, can I close the StageWebView?

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

This topic has been closed for replies.

1 reply

Inspiring
April 20, 2012

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

Inspiring
April 20, 2012

How do you use UIWebview in AS3?

I would love to hear someone working on a Native Extension for this!!!


Inspiring
April 20, 2012

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