From c0101c9ea30de2bd5d8bba84747524adab11d10f Mon Sep 17 00:00:00 2001 From: justinhunt Date: Mon, 12 Jun 2023 05:45:37 +0000 Subject: [PATCH 1/2] tidy up --- amd/src/poodll_readaloudmediaskin.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/amd/src/poodll_readaloudmediaskin.js b/amd/src/poodll_readaloudmediaskin.js index d422e739..3f31f36c 100644 --- a/amd/src/poodll_readaloudmediaskin.js +++ b/amd/src/poodll_readaloudmediaskin.js @@ -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': From 180a85516034e9e69598a20a53077c706a0ceee1 Mon Sep 17 00:00:00 2001 From: justinhunt Date: Tue, 13 Jun 2023 05:55:16 +0000 Subject: [PATCH 2/2] tweaks to fpminimal --- amd/src/audioplayer_minimal.js | 17 ++++++++++++----- pix/fpminimal-pause.svg | 7 +++++++ styles.css | 4 ++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 pix/fpminimal-pause.svg diff --git a/amd/src/audioplayer_minimal.js b/amd/src/audioplayer_minimal.js index 07a14dc0..2f27ed72 100644 --- a/amd/src/audioplayer_minimal.js +++ b/amd/src/audioplayer_minimal.js @@ -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 = { @@ -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){ @@ -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(){ @@ -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(){ diff --git a/pix/fpminimal-pause.svg b/pix/fpminimal-pause.svg new file mode 100644 index 00000000..d32fabeb --- /dev/null +++ b/pix/fpminimal-pause.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/styles.css b/styles.css index 383c8266..264bfe1e 100644 --- a/styles.css +++ b/styles.css @@ -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%;