Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Game is crashed after completion of video.... — Gideros Forum

Game is crashed after completion of video....

SarthakSarthak Member
edited February 2015 in General questions
I wanted to play video inside the game, and using media player, i did it.

It's working perfectly in Android devices, but in iOS devices, it will crashed after the completion of video with error message : "exc_bad_access code=1 address=0x91756e9a".

I have also tried the Xocde project of reference which got with media plugins, in it i am having same issue.

The lua code for playing video is as below:

if application:getDeviceInfo() == "iOS" or application:getDeviceInfo() == "Android" then
--require plugin
require "media"
end

if application:getDeviceInfo() == "iOS" or application:getDeviceInfo() == "Android" then
mediamanager:addEventListener(Event.VIDEO_COMPLETE, function()

end)
end

And after that i have exported project from gideros, and then added the contents of plugins folder from Media/ios inside exported project.

So please help me.

Thanks.

Comments

  • Got the solution...

    Thanks to my friend, who is ios developer.

    it is related with memory. In the plugins, there is a mediaplayer in being released,then after it is set as nil. To solve this

    In Xcode Project,
    Open GMediaClass.mm from Plugins folder, and then replace your stop method with below code,
    -(void)stop{
        if(self.Alayer != nil)
        {
            [self.Alayer removeFromSuperlayer];
            self.Alayer = nil;
            [self.Alayer release];
        }
        if(self.player != nil){
            [self.player pause];
            [self.player release];
            self.player = nil;
        }
        if([self superview]!=nil)
            [self removeFromSuperview];
    }
    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.