Skip to content

Commit

Permalink
Extend play/pause functionality to the minimized loading screen buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriles90 authored Oct 10, 2021
1 parent 0ea316e commit f3b1615
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions src/app/lib/views/player/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'click .backward': 'backwardStreaming',
'click .minimize-icon': 'minDetails',
'click .maximize-icon': 'minDetails',
'click #max_play_ctrl': 'maxPlayCtrl',
'click .show-pcontrols': 'showpcontrols',
'mousedown .title': 'copytoclip',
'mousedown .text_filename': 'copytoclip',
Expand Down Expand Up @@ -157,6 +158,12 @@
}
},

maxPlayCtrl: function (e) {
e.preventDefault();
e.stopPropagation();
$('.vjs-play-control').click();
},

onAttach: function() {
$('.filter-bar').hide();
$('#header').addClass('header-shadow');
Expand Down Expand Up @@ -200,6 +207,7 @@
if (streamInfo.get('device') && streamInfo.get('device').get('type') !== 'local') {
this.ui.player.text(streamInfo.get('device').get('name'));
this.ui.streaming.css('visibility', 'visible');
$('#max_play_ctrl').removeClass('fa-play').removeClass('play').addClass('fa-pause').addClass('pause');
}
this.ui.stateTextDownload.text(i18n.__('Downloading'));
this.ui.progressbar.parent().css('visibility', 'hidden');
Expand Down Expand Up @@ -381,13 +389,12 @@

pauseStreaming: function() {
App.vent.trigger('device:pause');
$('.pause').removeClass('fa-pause').removeClass('pause').addClass('fa-play').addClass('play');
$('.pause, #max_play_ctrl').removeClass('fa-pause').removeClass('pause').addClass('fa-play').addClass('play');
},

resumeStreaming: function() {
win.debug('Play triggered');
App.vent.trigger('device:unpause');
$('.play').removeClass('fa-play').removeClass('play').addClass('fa-pause').addClass('pause');
$('.play, #max_play_ctrl').removeClass('fa-play').removeClass('play').addClass('fa-pause').addClass('pause');
},

stopStreaming: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/app/templates/loading.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="fa fa-angle-down minimize-icon tooltipped" data-toggle="tooltip" data-placement="bottom" title="<%= i18n.__("Minimize") %>"></div>
<div class="maximize-icon">
<span class="buffer_percent"></span>
<span class="fa fa-play"></span>
<span class="fa fa-play" id="max_play_ctrl"></span>
<span class="title"></span>
<span id="maxdllb">@ </span>
<span class="download_speed value" id="maxdl"></span>
Expand Down

0 comments on commit f3b1615

Please sign in to comment.