Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Streaming problems on OS X



James try:

QTPlayer player;

...

private void startplaying(String url) {
try {
player = (QTPlayer)QTFactory.makeDrawable(url);
player.setRate(1f);
player.startTasking();
} catch (QTException err) {
err.printStackTrace();
}
}

If you want the Movie object or the MovieControler you can retrieve them
from the QTPlayer object without to much hassle.

Hope that helps all works here. Oh just to note.. It seems that the second
time you play a streaming track in QTJava it plays a lot better. I have
tryed just a very small hinted movie followed by a larger movie. It seems it
could be something to do with the movie. Maybe its not just QTJava but also
QuickTime. All seems to be ok on MacOSX mind.

tops (happy new year all)

aNt


> The same code, on Windows, never runs into these problems. I have just begun
> to dip into the QT API, so it may be something very basic that I'm missing.
> Any suggestions would be greatly appreciated!
>
> ----
> Movie m;
> MovieController mc;
> DataRef w;
> QTPlayer qtx;
> QTCanvas QTcanvas1;
> Boolean playing;
>
> ...
>
> private void startplaying(String s) {
> try {
> if (mc != null) {
> mc.play(0);
> playing = false;
> }
> w = new DataRef(s);
> m = Movie.fromDataRef(w, StdQTConstants.newMovieActive);
> mc = new MovieController(m);
> qtx = new QTPlayer(mc);
> QTcanvas1.setClient(qtx, true);
> mc.setActionFilter (new PMFilter(), true);
> qtx.startTasking();
> playing = true;
> mc.prerollAndPlay(1);
> //qtx.setRate(1); //same problems if this is called instead
> }




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.