|
|
@ -500,22 +500,21 @@ void UBGraphicsVideoItem::setSize(int width, int height) |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsVideoItem::videoSizeChanged(QSizeF newSize) |
|
|
|
void UBGraphicsVideoItem::videoSizeChanged(QSizeF newSize) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/* Depending on the platform, video size information becomes available
|
|
|
|
/* Depending on the platform/video backend, video size information becomes
|
|
|
|
* at different times (either when the file is loaded, or when playback |
|
|
|
* available at different times (either when the file is loaded, or when |
|
|
|
* begins), so this slot is needed to resize the video item as soon as |
|
|
|
* playback begins), so this slot is needed to resize the video item as |
|
|
|
* the information is available. |
|
|
|
* soon as the information is available. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// Don't resize the video item when playback has finished
|
|
|
|
|
|
|
|
bool shouldResize = (mMediaObject->mediaStatus() != QMediaPlayer::EndOfMedia); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef Q_OS_WIN |
|
|
|
// We don't want the video item to resize when the video is stopped or finished;
|
|
|
|
// Windows is a little confused about when a video ends
|
|
|
|
// and in those cases, the new size is reported as (0, 0).
|
|
|
|
shouldResize = (mMediaObject->mediaStatus() != QMediaPlayer::BufferedMedia); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (shouldResize) |
|
|
|
if (newSize != QSizeF(0,0)) |
|
|
|
this->setSize(newSize.width(), newSize.height()); |
|
|
|
this->setSize(newSize.width(), newSize.height()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else // Make sure the toolbar doesn't disappear
|
|
|
|
|
|
|
|
Delegate()->showToolBar(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|