Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
14700278
Commit
14700278
authored
Mar 07, 2016
by
Craig Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Video item: don't resize when video has finished or been stopped
+ clean-up in a few places
parent
09c06497
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
21 deletions
+22
-21
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+0
-4
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+10
-11
UBGraphicsMediaItemDelegate.cpp
src/domain/UBGraphicsMediaItemDelegate.cpp
+10
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+2
-6
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
14700278
...
...
@@ -677,10 +677,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene
->
addItem
(
videoItem
);
videoItem
->
show
();
//force start to load the video and display the first frame
videoItem
->
play
();
videoItem
->
pause
();
}
}
else
if
(
mXmlReader
.
name
()
==
"text"
)
//This is for backward compatibility with proto text field prior to version 4.3
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
14700278
...
...
@@ -500,22 +500,21 @@ void UBGraphicsVideoItem::setSize(int width, int height)
void
UBGraphicsVideoItem
::
videoSizeChanged
(
QSizeF
newSize
)
{
/* Depending on the platform
, video size information becomes available
* a
t different times (either when the file is loaded, or when playback
*
begins), so this slot is needed to resize the video item as soon
as
* the information is available.
/* Depending on the platform
/video backend, video size information becomes
* a
vailable at different times (either when the file is loaded, or when
*
playback begins), so this slot is needed to resize the video item
as
*
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
// Windows is a little confused about when a video ends
shouldResize
=
(
mMediaObject
->
mediaStatus
()
!=
QMediaPlayer
::
BufferedMedia
);
#endif
// We don't want the video item to resize when the video is stopped or finished;
// and in those cases, the new size is reported as (0, 0).
if
(
shouldResize
)
if
(
newSize
!=
QSizeF
(
0
,
0
)
)
this
->
setSize
(
newSize
.
width
(),
newSize
.
height
());
else
// Make sure the toolbar doesn't disappear
Delegate
()
->
showToolBar
();
}
...
...
src/domain/UBGraphicsMediaItemDelegate.cpp
View file @
14700278
...
...
@@ -231,9 +231,19 @@ void UBGraphicsMediaItemDelegate::mediaStatusChanged(QMediaPlayer::MediaStatus s
// Possible statuses are: UnknownMediaStatus, NoMedia, LoadingMedia, LoadedMedia,
// StalledMedia, BufferingMedia, BufferedMedia, EndOfMedia, InvalidMedia
//qDebug() << "Media status changed to " << status << "; state: " << delegated()->playerState();
if
(
status
==
QMediaPlayer
::
LoadedMedia
)
mMediaControl
->
totalTimeChanged
(
delegated
()
->
mediaDuration
());
// At the beginning of the video, play/pause to load and display the first frame
if
((
status
==
QMediaPlayer
::
LoadedMedia
||
status
==
QMediaPlayer
::
BufferedMedia
)
&&
delegated
()
->
mediaPosition
()
==
delegated
()
->
initialPos
())
{
delegated
()
->
play
();
delegated
()
->
pause
();
}
// in most cases, the only necessary action is to update the play/pause state
updatePlayPauseState
();
}
...
...
src/domain/UBGraphicsScene.cpp
View file @
14700278
...
...
@@ -1368,12 +1368,8 @@ UBGraphicsMediaItem* UBGraphicsScene::addMedia(const QUrl& pMediaFileUrl, bool s
UBApplication
::
undoStack
->
push
(
uc
);
}
mediaItem
->
play
();
if
(
!
shouldPlayAsap
)
{
mediaItem
->
pause
();
mediaItem
->
setMediaPos
(
0
);
}
if
(
shouldPlayAsap
)
mediaItem
->
play
();
setDocumentUpdated
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment