Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…_poodll into poodll3
  • Loading branch information
justinhunt committed Jun 16, 2023
2 parents c090207 + 180a855 commit a5e09a7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions amd/src/audioplayer_minimal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ define(['jquery','core/log'], function($, log) {
forwardbutton: '_fpminimal_audioplayer .fpminimal_audioplayer_skip_button_forward',
timedisplay: '_fpminimal_audioplayer .fpminimal_audioplayer_time'
}
var play_icon_url = require.toUrl('filter/poodll/pix/fpminimal_play.png');
var pause_icon_url = require.toUrl('filter/poodll/pix/fpminimal_stop.png');

var skipinterval =15;

var pr = {
Expand Down Expand Up @@ -55,10 +54,17 @@ define(['jquery','core/log'], function($, log) {
that.update_time();
});
$(this.hplayer).on('ended',function(){
$(that.ppbutton).css('background-image', play_icon_url);
$(that.ppbutton).attr('data-state','ended');
//reset the time display
$(that.timedisplay).text(that.formatAudioTime(that.duration));
});
$(this.hplayer).on('pause play', function(e) {
if (e.currentTarget.paused) {
$(that.ppbutton).attr('data-state','paused');
} else {
$(that.ppbutton).attr('data-state','playing');
}
});
$(this.hplayer).on('loadeddata',function(){
console.log("loadeddata", that.hplayer.duration);
if(that.hplayer.duration === Infinity){
Expand All @@ -67,6 +73,7 @@ define(['jquery','core/log'], function($, log) {
}else {
that.duration = that.hplayer.duration;
}
$(that.ppbutton).attr('data-state','paused');
that.update_time();
});
$(this.hplayer).on('canplaythrough',function(){
Expand All @@ -84,13 +91,13 @@ define(['jquery','core/log'], function($, log) {
console.log(this.hplayer);
this.hplayer.play().then(function(){
log.debug('play promise resolved');
$(that.ppbutton).css('background-image',pause_icon_url);
$(that.ppbutton).attr('data-state','playing');
}).catch(function(e){
log.debug(e,'play promise rejected');
});
}else{
this.hplayer.pause();
$(this.ppbutton).css('background-image:', play_icon_url);
$(that.ppbutton).attr('data-state','paused');
}
},
update_time: function(){
Expand Down
6 changes: 1 addition & 5 deletions amd/src/poodll_readaloudmediaskin.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,9 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', 'filter_poodll/upskin_r

break;

//not implemented
case 'countdownmode':

ip.controlbar.status.hide();
self.disable_button(ip.controlbar.startbutton);
self.disable_button(ip.controlbar.testbutton);
self.enable_button(ip.controlbar.placeholderbutton);
self.disable_button(ip.controlbar.stopbutton);
break;

case 'readymode':
Expand Down
7 changes: 7 additions & 0 deletions pix/fpminimal-pause.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5154,6 +5154,10 @@ video.poodll_multivideoplayer_video {
top: 36px;
}

.fpminimal_audioplayer_play_button[data-state="playing"] {
background-image: url([[pix:filter_poodll|fpminimal-pause]]);
}

.fpminimal_audioplayer_skip_buttons {
display: flex;
width: 100%;
Expand Down

0 comments on commit a5e09a7

Please sign in to comment.