objective c - QTMovie setRate problems -
i'm working on program prototype (at current stage) needs able load movie , adjust playback speed. have ui worked out, i've gotten playback work, haven't managed figure out how adjust playback speed.
i believed -[qtmovie setrate:(float)] way this, have had no luck. when setting playback speed prior loading movie qtmovieview, movie plays @ 100% speed. have put in textual outputs check @ speed movie "believes" being played, , checks out i've been putting in, movie still displays in view @ 100% speed.
here's code controller:
@interface srplayercontroller : nsobject { qtmovieview *movieview; } @end @implementation srplayercontroller -(void) playselectedmovie { srmovie *srm = [self selectedmovie]; qtmovie *mov = [self movieforsrmovie:srm]; //set play speed [self setplayspeed:[srm.defaultplayspeed floatvalue] formovie:mov]; //put movie viewer [movieview setmovie:mov]; //play [movieview play:self]; } -(void) setplayspeed:(float)ps formovie:(qtmovie*)movie { nslog(@"setting play speed %f", ps); [movie setrate:ps]; nslog(@"movie playing @ speed: %f", [movie rate]); } @end
i appreciate response.
apparently can't adjust playback when it's not playing. had change order of -playselectedmovie
calls playing before adjusted speed.
Comments
Post a Comment