Issue observed was that OpenBoard would crash on some Windows systems
when a video was on the page and that page was saved (due to switching
to document mode, auto saving, or duplicating the page), or when cutting
the video with Ctrl-X.
This was due to QTBUG-32522, where setting the video output for a
QMediaPlayer that is hidden results in a crash.
This commit is a work-around for this Qt issue, and so should be reverted
if and when the upstream issue is fixed.
- Selecting multiple media items then grouping them didn't behave as it
should for other items => fixed by adding type tests
- A group containing several media items wasn't saved to SVG with those media
items as children, due to incorrect UUID copying in the mediaItems's
deepCopy() methods
- Display a meaningful error message to the user when adding or trying
to play a video
- Make sure the video placeholder is visible even after switching pages
When a video is first loaded (placed on the scene), we play/pause it to
load the first frame; but this was also called when the video was
manually stopped. To avoid this, a mStopped attribute was added to
UBGraphicsMediaItem. It is set to true only when the video is stopped by
the user.
- Hovering over the video now makes the seek bar visible
- The size of the video item is no longer changed when the video
finishes playing
- Media errors are now handled by the mediaItem and displayed for the
user
- Code clean-up
- Removed inheritance of UBGraphicsProxyWidget; cleaned up related code
- Added two children classes: UBGraphicsVideoItem and
UBGraphicsAudioItem. UBGraphicsMediaItem is now an abstract class.
- Better encapsulation; the Scene and other external classes no longer
access the mediaObject directly
There is now less distinction between audio and video items to outside
code: apart from the UBSvgSubsetAdaptor, there is no need to know
whether a media item holds a video or audio file. Creation is handled
through the static function `UBGraphicsMediaItem::createMediaItem(URL,
parent)`
- Added an overload for setMatrix in UBGraphicsMediaItem, to propagate
matrix changes to the child videoItem
- Upon loading a video, the child videoItem is now added correctly, and
set to the right position
QVideoWidget had to be abandoned in favour of QGraphicsVideoItem. This
is because UBGraphicsMediaItem, i.e the class representing a media
(audio or video) object on the board, is a QGraphicsProxyWidget, and is
used to embed a QWidget into the Scene.
With Phonon's video widget, it was possible to embed the video widget in
this ProxyWidget. This is no longer possible (except on Windows, for
some reason), so this commit is a workaround, to use a
QGraphicsVideoItem instead of a QVideoWidget while modifying the rest
of the class hierarchy as little as possible.
Ultimately, a cleaner solution (not making UBGraphicsMediaItem inherit
QGraphicsProxyWidget, for example) may be desirable.
- Removed commented out obsolete code that had been added
- Removed objects that were never used (mAudioOutput, audioFormat etc)
- Re-made changes that had been reverted since commit cdb5633
Now coping creates a full copy of already created item. Copy has it's own content (like video, audio or folder) and stores original item properties (like locked, pos, size, freezed e.t.c.).
- locked items is not editable now.
- toolbar for text item hides when item is locked
Fixed behavior of toolbar:
toolbar of media items hides after 5s of idle.