static void HandleMediaTimeChanged(const libvlc_event_t * event, void * self)
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
- NSLog(@"time!");
[[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(mediaPlayerTimeChanged:)
withArgumentAsObject:[NSNumber numberWithLongLong:event->u.media_instance_time_changed.new_time]];
@end
@implementation VLCMediaPlayer
-+ (void)initialize {
- [self setKeys:[NSArray arrayWithObject:@"state"] triggerChangeNotificationsForDependentKey:@"playing"];
-}
- (id)init
{
{
if (self = [super init])
{
+ [VLCMediaPlayer setKeys:[NSArray arrayWithObject:@"state"] triggerChangeNotificationsForDependentKey:@"playing"];
+ [VLCMediaPlayer setKeys:[NSArray arrayWithObjects:@"state", @"media", nil] triggerChangeNotificationsForDependentKey:@"seekable"];
delegate = nil;
media = nil;
cachedTime = [[VLCTime nullTime] retain];
{
return cachedState;
}
+
- (float)position
{
return position;
}
+
- (void)setPosition:(float)newPosition
{
libvlc_exception_t ex;
libvlc_media_instance_set_position( instance, newPosition, &ex );
quit_on_exception( &ex );
}
+
+- (BOOL)isSeekable
+{
+ libvlc_exception_t ex;
+ libvlc_exception_init( &ex );
+ BOOL ret = libvlc_media_instance_is_seekable( instance, &ex );
+ quit_on_exception( &ex );
+ return ret;
+}
+
@end
@implementation VLCMediaPlayer (Private)