Re: NSMovie/NSMovieView problem
Re: NSMovie/NSMovieView problem
- Subject: Re: NSMovie/NSMovieView problem
- From: Alex Fuller <email@hidden>
- Date: Fri, 10 Jan 2003 19:16:55 +0000
Argghh, I've seen the error of my ways after much
banging-head-against-brick-wall: the NSMovieView was in an NSBox.
Bringing it out of the NSBox and placing it loose in the window enabled
it to play audio in all scenarios. Presumably it needs to be in a key
view or something. Another case where a simple one-liner in Apple's
docs would save people no end of frustration...
Alex
On Friday, January 10, 2003, at 06:28 pm, Alex Fuller wrote:
I'm trying to enable the user to play sounds files from my Cocoa app
by loading them into NSMovieViews, with little success. The original
files are WAVs, but these should be loadable as QuickTime movies. I
have tried:
1. Load WAV file directly using -initWithURL
Result: seems to load an empty movie - clicking the play button causes
the playhead to jump straight to the end of the controller timeline
bar.
2. Load WAV file as a Movie using QuickTime's OpenMovieFile() and
NewMovieFromFile() toolbox functions, then wrap in NSMovie with
-initWithMovie
Result: same as above. This is the method I would expect to work for
certain since NewMovieFromFile() will convert most foreign formats in
place transparently.
3. Load a .mov sound file (i.e. no video track) using either of the
above methods
Result: as before.
4. For sanity test, load a .mov file with video and audio tracks
Results: video plays fine, but I can't hear any audio. At least the
playhead doesn't shoot to the end of the controller.
All these files play fine if they're dropped on QuickTime Player by
the way.
I am left with two problems:
- when using a nice standard video clip, I can't hear any audio. This
seems really strange. I have added a sanity-check [theMovie
setVolume:1.0] to make sure there should be volume, but nothing.
- when loading an audio-only QuickTime movie, NSMovie seems to think
there's nothing there to play, as if it relies on a video track for
its timing data.
Can anyone help?
Alex
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.