Hello,
I am trying to write a customized video player, and I would like to have a
slider showing and controlling the QTMovie progress. I am using QTKit
(since I need Snow Leopard support, which is still widely used).

I have placed an NSSlider onto the view, and set it to "Continuous", so
that it sends action messages continuously when the slider is being
dragged. In the action method, I am calling QTMovie's setCurrentTime,
something like that:

-(IBAction)sliderMouseEvent:(id)sender {

NSEventType eventType = [[NSApp currentEvent] type];

NSTimeInterval duration;

QTTime time;

 switch (eventType) {

case NSLeftMouseDown:

if(isPlaying)

[currentMovie stop];

case NSLeftMouseDragged:

case NSScrollWheel:

time = QTMakeTime(1000*([sender doubleValue]*currentMovieDurationInSecs),
1000);

[currentMovie setCurrentTime:time];

break;

case NSLeftMouseUp:

if(isPlaying)

[currentMovie play];

break;

default:

break;

}

}


The problem is that when the user drags the knob, the dragging is "chunky"
(especially on slow laptops), because setting the current video position is
a lengthy process.

But the QuickTime X player allows to drag its timeline's knob smoothly..

How could I do the same in my application?


Thank you
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to