Hi, > I'm using QMediaPlayer and QGraphicsVideoItem to play a movie. > > I initialize the player like this: > > QMediaPlayer *player = new QMediaPlayer(); > player->setMedia(url); > QGraphicsVideoItem *video_item = new QGraphicsVideoItem(); > player->setVideoOutput(video_item); > > At this point, I'd like to be able to get the nativeSize() and > duration() of the movie. However, it seems these values aren't > available until some time later (after my application has returned > through the event loop; and after the mediaStatusChanged signal is > emitted from the player). > > Is there any way to force the media player and/or graphics video item > to calculate these values immediately (synchronously)?
No, loading is always done asynchronously. While it may be feasible to load a local file synchronously we also have to deal with network resources and the set up there can be prolonged process that mainly involves waiting, so loading is asynchronous. We also don't always have a choice in the matter, this is just how some backends work. Andrew _______________________________________________ Qt-mobility-feedback mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback
