Log in or register to post comments

App Crashing after Clicking the screen with Automatic playback

July 5, 2013 - 2:17am #1

I have added the following code to allow for automatic playback using a modified version of the Video Playback Sample App.

        if(currentStatus != PLAYING)
        {
            [videoPlayerHelper[playerIndex] play:NO fromPosition:-1.0f];
            currentStatus = [videoPlayerHelper[playerIndex] getStatus];
        }

Which starts the video playback perfectly. The issue comes when I tap on the screen, the app freezes with no error message in the Log. Where should I be looking to fix this?

App Crashing after Clicking the screen with Automatic playback

July 26, 2013 - 2:06am #6

What happened in the end - what problem did you encounter?

If you think this should be a feature, then please post in the wish list forum accordingly.

 

N

App Crashing after Clicking the screen with Automatic playback

July 26, 2013 - 1:21am #5

Hi NalinS,

This didn't work in the end, any ideas on what I can do to get autplaying and tap recognition working in the same app?

Thanks.

App Crashing after Clicking the screen with Automatic playback

July 9, 2013 - 8:18am #4

Thanks for the update.

Hope this works out ok :)

N

App Crashing after Clicking the screen with Automatic playback

July 9, 2013 - 6:33am #3

Thanks Nalin for the push in the right direction. I think I have found a decent work around and I'll post my code for anybody else that may need it in future. It just uses a boolean which decides whether to Auto Play the videos and a check to see if the video has changed.

All the code is in EAGLView.mm

@implementation EAGLView{
    BOOL autoPlay;
    int currentTriggerID;
}
#pragma mark - Lifecycle
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    autoPlay = YES; // Boolean to determinewhether to automatically play the videos
    currentTriggerID = -1;
- (void)renderFrameQCAR
{

// Code before the Switch


if (strcmp(imageTarget.getName(), "Whatever") == 0)
{
    playerIndex = 0;
}

if(currentTriggerID != playerIndex){
    autoPlay = YES;
}
else{
    autoPlay = NO;
}
currentTriggerID = playerIndex;


// More setup code
/*--------Set the video to play automatically--------*/
        
if(currentStatus != PLAYING && autoPlay)
{
    [videoPlayerHelper[playerIndex] play:NO fromPosition:-1.0f];
    currentStatus = [videoPlayerHelper[playerIndex] getStatus];
}
        
autoPlay = NO;
Need to do a bit of testing on this but it seems to hold up and do what I need it to do.

App Crashing after Clicking the screen with Automatic playback

July 5, 2013 - 4:47am #2

 

I think that when you pause the video by touching it, it may hang in 
 
- (void)waitForFrameTimerThreadToEnd
 
This is may be as a result of an interaction between the auto-start and touch-to-play behaviours - it might be  trying to restart immediately and never exiting the thread.
 
Please keep me posted if you manage to get this working :)
 
N
Log in or register to post comments