Hi all,
QuickTime Player plays movie which are available online, if the URL are provided. Is it possible to do the same with QuickTimeMovieComponent of juce.
In this regard, I can see this method.
If I create a InputStream out of the url and feed it to this method will it download and preview the video or buffer the contents of the file and start playing? Any help on this would be appreciated.
Hi Jules,
I have added a couple of methods to play from web on mac.
bool QuickTimeMovieComponent::loadMovie (const URL& fileUrl, const bool isControllerVisible)
{
closeMovie();
if (getPeer() == 0)
{
// To open a movie, this component must be visible inside a functioning window, so that
// the QT control can be assigned to the window.
jassertfalse
return false;
}
movie = openMovieFromURL (fileUrl);
[theMovie retain];
QTMovieView* view = (QTMovieView*) getView();
[view setMovie: theMovie];
[view setControllerVisible: controllerVisible];
setLooping (looping);
return movie != nil;
}
static QTMovie* openMovieFromURL (const URL& fileUrl)
{
// unfortunately, QTMovie objects can only be created on the main thread..
jassert (MessageManager::getInstance()->isThisTheMessageThread());
QTMovie* movie = 0;
if (fileUrl.isWellFormed ())
{
juce::String urlString = fileUrl.toString (true);
NSURL *url = [NSURL URLWithString :juceStringToNS(fileUrl.toString (true))];
NSError *error;
if ([ QTMovie canInitWithURL:url ])
movie = [QTMovie movieWithURL:url error:&error];
}
return movie;
}
It’s always a pleasure Jules . I have a question though. Can I use QTMovie to download a movie using Quicktime framework. I know it’s not the right place to ask this question but does anybody know :?: .
Yes, I want to preview and optionally download the file to local drive.I went through the Quicktime Documentation couldn’t find any method for doing it using Quictime.
Ended up using NSURLDownload to download the file.
My requirement is a little weird, I have to preview the video (from internet) if it’s not available locally on the user machine. If user has set the option “preview and download”, my application should download and also preview the movie simultaneously.
The documentation looked straight forward for Macintosh. Not able to find documentation for windows. It would be helpful if I could get the documentation.
Anyway I will give it a try tomorrow and get back to you.
Im facing a similar problem on Windows…I would like to stream a movie from the web using juce::QuickTimeMovieComponent(juce1_50)…Is there any way I could do that…