playing a quicktime movie in a QTMovieView

  • Hi,

    I have been unsuccessfully trying to load a QT movie and play it into
    a QTMovieView.  No matter which initialization method I try to use
    (for QTMovie) it returns a nil.  What am I doing wrong?

    Currently I have this -- but like I said, I've tried most appropriate
    initializers and can't get it to work.

    QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/Users/
    test/movie.mov"
                                              error:nil];

    --
    ivan
  • Ivan,

    You might try -movieWithQuickTimeMovie:disposeWhenDone:error:
    It's what I use, and it seems to work.

    Roland

    On Oct 16, 2006, at 3:36 PM, Ivan Kourtev wrote:

    > Hi,
    >
    > I have been unsuccessfully trying to load a QT movie and play it
    > into a QTMovieView.  No matter which initialization method I try to
    > use (for QTMovie) it returns a nil.  What am I doing wrong?
    >
    > Currently I have this -- but like I said, I've tried most
    > appropriate initializers and can't get it to work.
    >
    > QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/
    > Users/test/movie.mov"
    > error:nil];
  • On Oct 16, 2006, at 6:45 PM, Roland Torres wrote:

    > Ivan,
    > You might try -movieWithQuickTimeMovie:disposeWhenDone:error:
    > It's what I use, and it seems to work.

    Thanks for the tip.  Easier said than done -- I noticed that method
    but couldn't figure out how to create the Movie argument for the
    call.  Do you have any sample code that I can take a look at?

    Thanks.

    --
    ivan
    >
    > Roland
    >
    > On Oct 16, 2006, at 3:36 PM, Ivan Kourtev wrote:
    >
    >> Hi,
    >>
    >> I have been unsuccessfully trying to load a QT movie and play it
    >> into a QTMovieView.  No matter which initialization method I try
    >> to use (for QTMovie) it returns a nil.  What am I doing wrong?
    >>
    >> Currently I have this -- but like I said, I've tried most
    >> appropriate initializers and can't get it to work.
    >>
    >> QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/
    >> Users/test/movie.mov"
    >> error:nil];
    >
  • On 10/16/06, Ivan Kourtev <isk_lists...> wrote:
    > Hi,
    >
    > I have been unsuccessfully trying to load a QT movie and play it into
    > a QTMovieView.  No matter which initialization method I try to use
    > (for QTMovie) it returns a nil.  What am I doing wrong?
    >
    > Currently I have this -- but like I said, I've tried most appropriate
    > initializers and can't get it to work.
    >
    > QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/Users/
    > test/movie.mov"
    > error:nil];

    Did you try getting an error back from those methods to see why it is
    failing to work?

    NSError* error = nil;
    QTMovie* qtmov = [[QTMovie alloc] initWithFile:@"movie.mov" error:&error];
    if (error != nil) {
      NSLog(@"%@", [error localizedDescription]);
    }

    -Shawn
  • If I am not mistaken I've run into a problem before (I don't have a way to
    prove / disprove this atm) that if that location does not exist or perhaps
    not accessible the initWithFile will not return a valid error object. This
    is off the top of my head so keep this in mind.

    -----Original Message-----
    From: cocoa-dev-bounces+byron=<bluebearstudio.com...>
    [mailto:cocoa-dev-bounces+byron=<bluebearstudio.com...>] On
    Behalf Of Ivan Kourtev
    Sent: Monday, October 16, 2006 4:05 PM
    To: Roland Torres
    Cc: Apple Mailing List
    Subject: Re: playing a quicktime movie in a QTMovieView

    On Oct 16, 2006, at 6:45 PM, Roland Torres wrote:

    > Ivan,
    > You might try -movieWithQuickTimeMovie:disposeWhenDone:error:
    > It's what I use, and it seems to work.

    Thanks for the tip.  Easier said than done -- I noticed that method but
    couldn't figure out how to create the Movie argument for the call.  Do you
    have any sample code that I can take a look at?

    Thanks.

    --
    ivan
    >
    > Roland
    >
    > On Oct 16, 2006, at 3:36 PM, Ivan Kourtev wrote:
    >
    >> Hi,
    >>
    >> I have been unsuccessfully trying to load a QT movie and play it into
    >> a QTMovieView.  No matter which initialization method I try to use
    >> (for QTMovie) it returns a nil.  What am I doing wrong?
    >>
    >> Currently I have this -- but like I said, I've tried most appropriate
    >> initializers and can't get it to work.
    >>
    >> QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/
    >> Users/test/movie.mov"
    >> error:nil];
    >

    _______________________________________________
    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list      (<Cocoa-dev...>)
    Help/Unsubscribe/Update your Subscription:
    http://lists.apple.com/mailman/options/cocoa-dev/<byron...>

    This email sent to <byron...>

    --
    No virus found in this incoming message.
    Checked by AVG Free Edition.
    Version: 7.1.408 / Virus Database: 268.13.4/476 - Release Date: 10/14/2006


    --
    No virus found in this outgoing message.
    Checked by AVG Free Edition.
    Version: 7.1.408 / Virus Database: 268.13.4/476 - Release Date: 10/14/2006
  • Ivan,

    Use QTMovie +movieWithFile:error: instead.

    NSError *error = nil;
    NSString *myMovie = @"/Volumes/BigD/Users/test/movie.mov";
    QTMovie    *qtMovie = [QTMovie movieWithFile:myMovie error:&error];
    if (error) {
      // check out the error
    } else {
      [qtMovie gotoBeginning];
      [qtMovie play];
    }

    Roland

    On Oct 16, 2006, at 4:05 PM, Ivan Kourtev wrote:

    > On Oct 16, 2006, at 6:45 PM, Roland Torres wrote:
    >
    >> Ivan,
    >> You might try -movieWithQuickTimeMovie:disposeWhenDone:error:
    >> It's what I use, and it seems to work.
    >
    > Thanks for the tip.  Easier said than done -- I noticed that method
    > but couldn't figure out how to create the Movie argument for the
    > call.  Do you have any sample code that I can take a look at?
    >
    > Thanks.
    >
    > --
    > ivan
    >>
    >> Roland
    >>
    >> On Oct 16, 2006, at 3:36 PM, Ivan Kourtev wrote:
    >>
    >>> Hi,
    >>>
    >>> I have been unsuccessfully trying to load a QT movie and play it
    >>> into a QTMovieView.  No matter which initialization method I try
    >>> to use (for QTMovie) it returns a nil.  What am I doing wrong?
    >>>
    >>> Currently I have this -- but like I said, I've tried most
    >>> appropriate initializers and can't get it to work.
    >>>
    >>> QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/
    >>> Users/test/movie.mov"
    >>> error:nil];
    >>
    >
    >
  • On 10/16/06, Roland Torres <newslists...> wrote:

    > Use QTMovie +movieWithFile:error: instead.

    Why? Is -[QTMovie initWithFile:error:] broken?

    I think we should understand what is failing in his situation and why.

    -Shawn
  • Roland,

    Still not working.  I had literally the same code suggested here and
    the crazy part is that error is not even set by
    movieWithFile:error:.  I tried initing the movie with a URL instead -
    no luck reagrdless of whether the URL is the local file or an
    http://... address.  I also tried calling +[QTMovie canInitWithFile]
    and +[QTMovie canInitWithURL] and they both return NO.

    I finally felt like I was getting somewhere when I tried
    movieWithAttributes:error: and ZeroLink complained that
    _QTMovieFileNameAttribute was an unknown symbol.  So I think the QT
    framework is not linked.  How is that possible if I personally put
    the QuickTime.framework in the Link Binary with Libraries build phase?

    If it helps, I noticed I had to #import <QTKit/QTMovie.h> and #import
    <QTKit/QTMovieView.h> or my code wouldn't compile. Otherwise, I am
    completely stumped.

    --
    ivan

    On Oct 16, 2006, at 7:27 PM, Roland Torres wrote:

    > Ivan,
    >
    > Use QTMovie +movieWithFile:error: instead.
    >
    > NSError *error = nil;
    > NSString *myMovie = @"/Volumes/BigD/Users/test/movie.mov";
    > QTMovie    *qtMovie = [QTMovie movieWithFile:myMovie error:&error];
    > if (error) {
    > // check out the error
    > } else {
    > [qtMovie gotoBeginning];
    > [qtMovie play];
    > }
    >
    > Roland
    >
    >
    > On Oct 16, 2006, at 4:05 PM, Ivan Kourtev wrote:
    >
    >> On Oct 16, 2006, at 6:45 PM, Roland Torres wrote:
    >>
    >>> Ivan,
    >>> You might try -movieWithQuickTimeMovie:disposeWhenDone:error:
    >>> It's what I use, and it seems to work.
    >>
    >> Thanks for the tip.  Easier said than done -- I noticed that
    >> method but couldn't figure out how to create the Movie argument
    >> for the call.  Do you have any sample code that I can take a look at?
    >>
    >> Thanks.
    >>
    >> --
    >> ivan
    >>>
    >>> Roland
    >>>
    >>> On Oct 16, 2006, at 3:36 PM, Ivan Kourtev wrote:
    >>>
    >>>> Hi,
    >>>>
    >>>> I have been unsuccessfully trying to load a QT movie and play it
    >>>> into a QTMovieView.  No matter which initialization method I try
    >>>> to use (for QTMovie) it returns a nil.  What am I doing wrong?
    >>>>
    >>>> Currently I have this -- but like I said, I've tried most
    >>>> appropriate initializers and can't get it to work.
    >>>>
    >>>> QTMovie *qtmov = [[QTMovie alloc] initWithFile:@"/Volumes/BigD/
    >>>> Users/test/movie.mov"
    >>>> error:nil];
    >>>
    >>
    >>
    >
  • On Oct 16, 2006, at 7:30 PM, Ivan Kourtev wrote:

    > I finally felt like I was getting somewhere when I tried
    > movieWithAttributes:error: and ZeroLink complained that
    > _QTMovieFileNameAttribute was an unknown symbol.  So I think the QT
    > framework is not linked.  How is that possible if I personally put
    > the QuickTime.framework in the Link Binary with Libraries build phase?

    Are you also linking to the QTKit framework? QTMovieView et al. are
    in QTKit, not QuickTime.

    Nick Zitzmann
    <http://www.chronosnet.com/>
  • Linking to QTKit did it, thanks!

    --
    ivan

    On Oct 16, 2006, at 9:38 PM, Nick Zitzmann wrote:

    >
    > On Oct 16, 2006, at 7:30 PM, Ivan Kourtev wrote:
    >
    >> I finally felt like I was getting somewhere when I tried
    >> movieWithAttributes:error: and ZeroLink complained that
    >> _QTMovieFileNameAttribute was an unknown symbol.  So I think the
    >> QT framework is not linked.  How is that possible if I personally
    >> put the QuickTime.framework in the Link Binary with Libraries
    >> build phase?
    >
    > Are you also linking to the QTKit framework? QTMovieView et al. are
    > in QTKit, not QuickTime.
    >
    > Nick Zitzmann
    > <http://www.chronosnet.com/>
    >
    >
  • Am 17.10.2006 um 03:30 schrieb Ivan Kourtev:
    > I finally felt like I was getting somewhere when I tried
    > movieWithAttributes:error: and ZeroLink complained that
    > _QTMovieFileNameAttribute was an unknown symbol.  So I think the QT
    > framework is not linked.  How is that possible if I personally put
    > the QuickTime.framework in the Link Binary with Libraries build phase?

      Unless you badly need fix and continue or you have an incredibly
    large project, turn off ZeroLink. Your sleep will be much sounder
    because you'll get proper error messages.

      In your case, I guess what happened is that QTMovie didn't get
    linked, didn't get loaded and thus got set to Nil. And sending a
    message that returns an object to Nil gives you nil. At least that's
    my guess. It's kinda unusual that ZeroLink would weak-link a symbol
    in that way, and not show an error message when methods from that
    library are used, but lots of odd things happen with ZeroLink.

    Cheers,
    -- M. Uli Kusterer
    http://www.zathras.de
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today