Show playback controls for GIFs
This commit is contained in:
parent
938afea533
commit
4c54f4ef35
1 changed files with 15 additions and 13 deletions
|
|
@ -704,7 +704,7 @@ void OverlayWidget::refreshCaptionGeometry() {
|
||||||
_groupThumbs = nullptr;
|
_groupThumbs = nullptr;
|
||||||
_groupThumbsRect = QRect();
|
_groupThumbsRect = QRect();
|
||||||
}
|
}
|
||||||
const auto captionBottom = (_streamed && !videoIsGifv())
|
const auto captionBottom = (_streamed/* && !videoIsGifv()*/)
|
||||||
? (_streamed->controls.y() - st::mediaviewCaptionMargin.height())
|
? (_streamed->controls.y() - st::mediaviewCaptionMargin.height())
|
||||||
: _groupThumbs
|
: _groupThumbs
|
||||||
? _groupThumbsTop
|
? _groupThumbsTop
|
||||||
|
|
@ -876,7 +876,7 @@ void OverlayWidget::contentSizeChanged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayWidget::resizeContentByScreenSize() {
|
void OverlayWidget::resizeContentByScreenSize() {
|
||||||
const auto bottom = (!_streamed || videoIsGifv())
|
const auto bottom = (!_streamed/* || videoIsGifv()*/)
|
||||||
? height()
|
? height()
|
||||||
: (_streamed->controls.y()
|
: (_streamed->controls.y()
|
||||||
- st::mediaviewCaptionPadding.bottom()
|
- st::mediaviewCaptionPadding.bottom()
|
||||||
|
|
@ -1150,7 +1150,7 @@ void OverlayWidget::onHideControls(bool force) {
|
||||||
|| _menu
|
|| _menu
|
||||||
|| _mousePressed
|
|| _mousePressed
|
||||||
|| (_fullScreenVideo
|
|| (_fullScreenVideo
|
||||||
&& !videoIsGifv()
|
/*&& !videoIsGifv()*/
|
||||||
&& _streamed->controls.geometry().contains(_lastMouseMovePos))) {
|
&& _streamed->controls.geometry().contains(_lastMouseMovePos))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1742,7 +1742,7 @@ void OverlayWidget::refreshCaption(HistoryItem *item) {
|
||||||
|
|
||||||
using namespace HistoryView;
|
using namespace HistoryView;
|
||||||
_caption = Ui::Text::String(st::msgMinWidth);
|
_caption = Ui::Text::String(st::msgMinWidth);
|
||||||
const auto duration = (_streamed && !videoIsGifv())
|
const auto duration = (_streamed/* && !videoIsGifv()*/)
|
||||||
? _doc->getDuration()
|
? _doc->getDuration()
|
||||||
: 0;
|
: 0;
|
||||||
const auto base = duration
|
const auto base = duration
|
||||||
|
|
@ -2247,12 +2247,12 @@ bool OverlayWidget::createStreamingObjects() {
|
||||||
|| _doc->isVoiceMessage()
|
|| _doc->isVoiceMessage()
|
||||||
|| _doc->isVideoMessage();
|
|| _doc->isVideoMessage();
|
||||||
|
|
||||||
if (videoIsGifv()) {
|
// if (videoIsGifv()) {
|
||||||
_streamed->controls.hide();
|
// _streamed->controls.hide();
|
||||||
} else {
|
// } else {
|
||||||
refreshClipControllerGeometry();
|
refreshClipControllerGeometry();
|
||||||
_streamed->controls.show();
|
_streamed->controls.show();
|
||||||
}
|
// }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2413,7 +2413,7 @@ void OverlayWidget::initThemePreview() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayWidget::refreshClipControllerGeometry() {
|
void OverlayWidget::refreshClipControllerGeometry() {
|
||||||
if (!_streamed || videoIsGifv()) {
|
if (!_streamed/* || videoIsGifv()*/) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2448,9 +2448,9 @@ void OverlayWidget::playbackControlsFromFullScreen() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayWidget::playbackControlsToPictureInPicture() {
|
void OverlayWidget::playbackControlsToPictureInPicture() {
|
||||||
if (!videoIsGifv()) {
|
//if (!videoIsGifv()) {
|
||||||
switchToPip();
|
switchToPip();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayWidget::playbackControlsRotate() {
|
void OverlayWidget::playbackControlsRotate() {
|
||||||
|
|
@ -2579,7 +2579,7 @@ void OverlayWidget::playbackControlsSpeedChanged(float64 speed) {
|
||||||
_doc->session().settings().setVideoPlaybackSpeed(speed);
|
_doc->session().settings().setVideoPlaybackSpeed(speed);
|
||||||
_doc->session().saveSettingsDelayed();
|
_doc->session().saveSettingsDelayed();
|
||||||
}
|
}
|
||||||
if (_streamed && !videoIsGifv()) {
|
if (_streamed/* && !videoIsGifv()*/) {
|
||||||
DEBUG_LOG(("Media playback speed: %1 to _streamed.").arg(speed));
|
DEBUG_LOG(("Media playback speed: %1 to _streamed.").arg(speed));
|
||||||
_streamed->instance.setSpeed(speed);
|
_streamed->instance.setSpeed(speed);
|
||||||
}
|
}
|
||||||
|
|
@ -2620,7 +2620,7 @@ void OverlayWidget::switchToPip() {
|
||||||
void OverlayWidget::playbackToggleFullScreen() {
|
void OverlayWidget::playbackToggleFullScreen() {
|
||||||
Expects(_streamed != nullptr);
|
Expects(_streamed != nullptr);
|
||||||
|
|
||||||
if (!videoShown() || (videoIsGifv() && !_fullScreenVideo)) {
|
if (!videoShown()/* || (videoIsGifv() && !_fullScreenVideo)*/) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_fullScreenVideo = !_fullScreenVideo;
|
_fullScreenVideo = !_fullScreenVideo;
|
||||||
|
|
@ -2673,9 +2673,11 @@ void OverlayWidget::playbackPauseMusic() {
|
||||||
void OverlayWidget::updatePlaybackState() {
|
void OverlayWidget::updatePlaybackState() {
|
||||||
Expects(_streamed != nullptr);
|
Expects(_streamed != nullptr);
|
||||||
|
|
||||||
|
/*
|
||||||
if (videoIsGifv()) {
|
if (videoIsGifv()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
const auto state = _streamed->instance.player().prepareLegacyState();
|
const auto state = _streamed->instance.player().prepareLegacyState();
|
||||||
if (state.position != kTimeUnknown && state.length != kTimeUnknown) {
|
if (state.position != kTimeUnknown && state.length != kTimeUnknown) {
|
||||||
_streamed->controls.updatePlayback(state);
|
_streamed->controls.updatePlayback(state);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue