Copy link to clipboard
Copied
Hi all,
We are trying to play several clips sequence with VideoTextures but code is crashing unpredictably on iOS devices from time to time.
I have created sample codebase for it, so one can try it. Sources are here https://www.dropbox.com/s/wdnf5q2zrq73f1l/VideoTextureTest.zip?dl=0 Here is full logic of what is happening:
package videotexturetest.views.application
{
import feathers.controls.ImageLoader;
import flash.events.NetStatusEvent;
import flash.net.NetConnection;
import flash.net.NetStream;
import starling.display.Sprite;
import starling.events.Event;
import starling.textures.Texture;
public class ApplicationView extends Sprite
{
private var _currentIndex = 1;
private var _numVideos = 8;
private var _image:ImageLoader;
private var _connection:NetConnection;
private var _currentStream:NetStream;
private var _currentTexture:Texture;
private var _nextStream:NetStream;
private var _nextTexture:Texture;
public function ApplicationView()
{
addEventListener(Event.ADDED_TO_STAGE, function(event:Event):void
{
initialize();
});
}
private function prepareNextStream():void
{
if (_currentIndex == _numVideos)
{
_nextStream = null;
_nextTexture = null;
return;
}
trace("Preparing next texture:", "videos/clip_" + (_currentIndex + 1) + ".mp4");
// Second NetStream connection
_nextStream = new NetStream(_connection);
_nextStream.client = { onMetaData : function(infoObject:Object) {} };
Texture.fromNetStream(_nextStream, 1, function(texture:Texture):void
{
trace("Video texture is ready:", "videos/clip_" + (_currentIndex + 1) + ".mp4");
_nextTexture = texture;
_nextStream.togglePause();
});
_nextStream.play("videos/clip_" + (_currentIndex + 1) + ".mp4");
}
private function initialize():void
{
_image = new ImageLoader();
_image.setSize(stage.stageWidth, stage.stageHeight);
addChild(_image);
_connection = new NetConnection();
_connection.connect(null);
// First NetStream connection
_currentStream = new NetStream(_connection);
_currentStream.client = { onMetaData : function(infoObject:Object) {} };
_currentStream.addEventListener(NetStatusEvent.NET_STATUS, function(event:NetStatusEvent):void
{
if (event.info.code == 'NetStream.Play.Stop' && _nextStream)
{
var stream:NetStream = event.target as NetStream;
stream.removeEventListener(NetStatusEvent.NET_STATUS, arguments.callee);
_currentIndex++;
_nextStream.addEventListener(NetStatusEvent.NET_STATUS, arguments.callee);
_image.source = _nextTexture;
_nextStream.togglePause();
_currentTexture.dispose();
_currentStream.close();
_currentTexture = _nextTexture;
_currentStream = _nextStream;
prepareNextStream();
}
});
Texture.fromNetStream(_currentStream, 1, function(texture:Texture):void
{
trace("Video texture is ready:", "videos/clip_" + _currentIndex + ".mp4");
_currentTexture = texture;
_image.source = _currentTexture;
});
prepareNextStream();
_currentStream.play("videos/clip_" + _currentIndex + ".mp4");
}
}
}
Two streams exist as same time. One for current video and second one for next one. It allows us to switch videos without flickering. Code works fine on desktop (air simulator) but when I try to launch it in real ios device app is crashing and I have the following error in device logs:
May 29 07:41:57 iPhone-Alexey ReportCrash[3541] <Notice>: ReportCrash acting against PID 3540
May 29 07:41:57 iPhone-Alexey ReportCrash[3541] <Notice>: Formulating crash report for process VideoTextureTest[3540]
May 29 07:41:57 iPhone-Alexey com.apple.launchd[1] (UIKitApplication:VideoTextureTest[0x917b][3540]) <Warning>: (UIKitApplication:VideoTextureTest[0x917b]) Job appears to have crashed: Segmentation fault: 11
May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Warning>: 07:41:57.609 [0x3f31000] CMSession retain count > 1!
May 29 07:41:57 iPhone-Alexey backboardd[28] <Warning>: Application 'UIKitApplication:VideoTextureTest[0x917b]' exited abnormally with signal 11: Segmentation fault: 11
May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Warning>: Encountered an XPC error while communicating with backboardd: <error: 0x3c8d7744> { count = 1, contents =
"XPCErrorDescription" => <string: 0x3c8d79dc> { length = 22, contents = "Connection interrupted" }
}
May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Error>: 07:41:57.670 [0x4035000] sessionID = 0xbff6e4: cannot get ClientInfo
May 29 07:41:57 iPhone-Alexey mediaserverd[3071] <Error>: 07:41:57.673 ERROR: [0x4035000] 150: AudioQueue: Error 'ini?' from AudioSessionSetClientPlayState(0xbff6e4)
Could anyone suggest something about this issue? Is it a problem in NetStream or it somehow connected to VideoTexture?
Same information was published in Starling forum VideoTexture « Starling Forum
Copy link to clipboard
Copied
I have been able to reproduce this problem (crashes) from provided AS source; with latest/previous labs sdk
iPhone5 - 6.0.1
iPad3 - 7.1.2
Has anyone in the community managed to get multiple Netstream's via videoTextureworking correctly to switch video clip playback on IOS or Android devices without intermitentcrash issues?
(@) Adobe team - useful to know if this is a known issue or any workarounds?been scratching my head on this issue for the last week!
Copy link to clipboard
Copied
Thanks for reporting the issue.
We are able to reproduce the issue and logged an internal bug 3998622 for the same. we will investigation it and update you soon.
Regards,
Adobe AIR team
Copy link to clipboard
Copied
Hi Jitender
Can you confirm the status of 3998622?
Appreciate 3 weeks have now elapsed since time of last comment/issue replication. Has there been any progress, can we expect future release addressing this issue?
BTW: We are trying to plan the launch phase of an application, subject to this bug being addressed.
Any updates would be greatley appreciated.
Copy link to clipboard
Copied
Hi Marcus,
Thanks for being patient. We are working on the fix and will update you as soon as it get fixed.
Regards,
Adobe AIR Team
Copy link to clipboard
Copied
Hi Jitender
Did the fix for bug for '3998622' make it into the latest AIR 19 Beta release on July 16, 2015.
I couldn't see any reference to your internal issue number in the release notes.
If this is NOT yet fixed.
A) is this fix actually in progress or being worked on.
B) When can we expect a release to address this bug?
Hope you can appreciate this was first reported on May 29th.
best regards
Marcus
Copy link to clipboard
Copied
Hi Marcus,
We are working on this issue on priority . Please expect fix for this issue in our next beta. We will keep you posted.
Thanks,
Adobe Air Team
Copy link to clipboard
Copied
thanks for the update Anki.
Copy link to clipboard
Copied
I now see beta release for AIR Runtime: 19.0.0147.
However I cant see issue '3998622' in the release notes. Can you confirm if this was completed?
Copy link to clipboard
Copied
Hi Marcus,
Yes the fix for this issue is out with current beta build at Adobe AIR 19 Beta | application development - Adobe Labs.
Please try it at your end and in case, you still encounter the issue, do let us know.
Regards,
Adobe AIR team
Copy link to clipboard
Copied
Thanks guys!
We will test and report back any findings on this thread.
Copy link to clipboard
Copied
Marcus did the fix work for you?
Copy link to clipboard
Copied
Air 32, on iOS when creating a NetStream (DIRECT mode), application crashes when brought to background and brought back to foreground.
iOS 8, 9 and 12, and AIR 26, 27, 29, 31 and 32.
All the same behavior.
Application works perfectly, but once brought to background, if I bring it back to foreground crashes immediately.