Skip to content

Commit

Permalink
Add wavesurfer lib and improve rendering of scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
markusweigelt committed Sep 19, 2023
1 parent a96dfae commit 43adb59
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* GPL3-License.txt file that was distributed with this source code.
*/

import WaveSurfer from 'https://unpkg.com/wavesurfer.js@beta'
import WaveSurfer from './libs/wavesurfer/wavesurfer.esm.js.jsf'

let audios = document.querySelectorAll('audio.mediaPreviewItem');

Expand Down Expand Up @@ -54,6 +54,3 @@ wavesurfer.once('decode', () => {
wavesurfer.on("error", function (e) {
console.warn(e);
});

// Load audio from URL
//wavesurfer.load(audio);
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<f:param name="type" value="#{selectedGalleryMediaContent.mediaViewMimeType}"/>
<f:param name="krsc" value="true"/>
</p:media>

<h:outputScript a:type="module" name="js/media_detail_audio.js" />
<h:outputScript a:type="module" name="js/libs/wavesurfer/wavesurfer.esm.js" rendered="#{fn:startsWith(selectedGalleryMediaContent.mediaViewMimeType, 'audio')}" />
<h:outputScript a:type="module" name="js/media_detail_audio.js" rendered="#{fn:startsWith(selectedGalleryMediaContent.mediaViewMimeType, 'audio')}" />
</ui:fragment>

<ui:fragment
Expand Down

0 comments on commit 43adb59

Please sign in to comment.