Hi,

Got it finally working with Blocks. But I am not sure whether this is the
right way.. Is there any better way to determine playing started or not ??

// add time observer
// obs (id) defined in class header
    obs = [[player addPeriodicTimeObserverForInterval:CMTimeMake(1, 3)
                                         queue:NULL
                                    usingBlock:^(CMTime time){
                                        if
(player.currentItem.asset.duration.timescale == 0) {
                                            NSLog(@"PLAY %f",
player.currentItem.asset.duration.timescale);
                                            [player removeTimeObserver:obs];
                                        } else {
                                            NSLog(@"PREPARING %f %d",
player.currentItem.asset.duration.timescale, time.value);
                                        }

                                    }] retain];

Thanks,

Tharindu
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to