MediaPlayer ANE, App freeze or crash on removePlayer()
I have a simple app for both iOS & Android, on click a button a video will play full screen.
on MediaPlayerEvent.FULLSCREEN_EXIT, MediaPlayerEvent.STOPPED or MediaPlayerEvent.COMPLETE I remove the player with MediaPlayer.service.removePlayer();
on Android the app will crash with "Unfortunately the app has stopped"
on iOS 6 the app will freeze with black screen
on iOS 7 it works correctly
I have also tried calling stop before removePlayer, no difference
Is this a bug or am I missing something
thanks
Following in github: https://github.com/distriqt/airnativeextensions/issues/197
-
Anonymous commented
I don't have access to a iOS 6 device right now. hopefully will get access in next few days, then will post the log.
any ETA for an Android fix?
thanks
-
Thanks,
I'll check into this, any chance of getting the logs from iOS as well?
-
Anonymous commented
Hi I was able to install adb without installing entire sdk. here is the bottom of logcat
-
Hi,
Can you get the device logs at all? i.e. from Xcode console or from adb logcat?
-
Anonymous commented
I just checked the example MediaPlayer app. Same issue happens when it reaches the end of the video
-
Anonymous commented
Console log bellow
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -d32 "-Dapplication.home=/Applications/Apache Flex/SDKs/413" -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m -classpath "/Applications/Apache Flex/SDKs/413/lib/fdb.jar" flex.tools.debugger.cli.DebugCLI -ide -p 7936
Apache fdb (Flash Player Debugger) [build 20140701]
Copyright 2013 The Apache Software Foundation. All rights reserved.
Trying to connect to Player
Player connected; session starting.
[trace] [Starling] Initialization complete.
[trace] [Starling] Display Driver: OpenGL (Baseline Constrained)
[trace] MediaPlayer ready
[trace] MediaPlayer duration: 120.883
[trace] event: mediaplayer:playing ::
[trace] event: fullscreen:enter ::
[trace] event: fullscreen:exit ::
[trace] event: mediaplayer:stopped :: -
Anonymous commented
I should also note, im using the latest versions of Starling & Feathers
-
Anonymous commented
sure bellow is my code.
im using intelij IDEA 13. there is nothing in console log related to MediaPlayerprivate var _videoDisplayed:Boolean;
protected function initializeHandler(event:Event):void
{
MediaPlayer.init( _devKey );MediaPlayer.service.addEventListener( MediaPlayerEvent.READY, mediaPlayer_readyHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaPlayerEvent.COMPLETE, mediaPlayer_completeHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaErrorEvent.ERROR, mediaPlayer_errorHandler, false, 0, true );MediaPlayer.service.addEventListener( MediaPlayerEvent.PAUSED, mediaPlayer_generalHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaPlayerEvent.PLAYING, mediaPlayer_generalHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaPlayerEvent.SEEKING, mediaPlayer_generalHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaPlayerEvent.STOPPED, mediaPlayer_generalHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaPlayerEvent.FULLSCREEN_ENTER, mediaPlayer_generalHandler, false, 0, true );
MediaPlayer.service.addEventListener( MediaPlayerEvent.FULLSCREEN_EXIT, mediaPlayer_generalHandler, false, 0, true );this.addChild(this._btnGroup);
}
function start_triggeredHandler( event:Event ):void
{var path:String = File.applicationDirectory.nativePath + File.separator + "video.mp4";
MediaPlayer.service.createPlayer( path, 0, 0, stage.stageWidth, stage.stageHeight, true, MediaPlayer.CONTROLS_FULLSCREEN, false );
_videoDisplayed = true;}
private function mediaPlayer_readyHandler( event:MediaPlayerEvent ):void
{
MediaPlayer.service.play();
MediaPlayer.service.setFullscreen(true, false);
}private function mediaPlayer_completeHandler( event:MediaPlayerEvent ):void
{
if (_videoDisplayed == true) {
MediaPlayer.service.removePlayer();
_videoDisplayed = false;
}
}private function mediaPlayer_errorHandler( event:MediaErrorEvent ):void
{
trace( "error: "+ event.code + "::"+event.description );
}private function mediaPlayer_generalHandler( event:MediaPlayerEvent ):void
{if (_videoDisplayed == true && (event.type == MediaPlayerEvent.STOPPED || event.type == MediaPlayerEvent.FULLSCREEN_EXIT))
{
MediaPlayer.service.removePlayer();
_videoDisplayed = false;
}
} -
Hi,
Can you post the code you are using and the logs, from the Xcode console or from Android adb logcat?
Cheers