diff --git a/README.md b/README.md index 91b4c0c..3a693f6 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,12 @@ export default { ## Docs You can see the complete documentation with examples here: [https://vue-cool-lightbox.lucaspulliese.com/](https://vue-cool-lightbox.lucaspulliese.com/). +## Supported contents +- Images +- Videos +- Audios (mp3, wav, ogg) +- iFrames + ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. diff --git a/src/components/CoolLightBox.vue b/src/components/CoolLightBox.vue index 8f14eae..b543595 100644 --- a/src/components/CoolLightBox.vue +++ b/src/components/CoolLightBox.vue @@ -171,6 +171,19 @@ Sorry, your browser doesn't support embedded videos + + + @@ -274,6 +287,19 @@ Sorry, your browser doesn't support embedded videos + + + @@ -1828,6 +1854,41 @@ export default { return false }, + checkIsAudio(url) { + if(this.imgIndex === null) { + return false + } + + const str = new String(url); + if( + (str.indexOf('.mp3') !== -1) || + (str.indexOf('.ogg') !== -1) || + (str.indexOf('.wav') !== -1) + ) { + return url + } + + return false + }, + + // if is video get extension + getAudioExt(url) { + if(this.imgIndex === null) { + return false + } + + const str = new String(url); + if(str.indexOf('.mp3') !== -1 || str.indexOf('.wav') !== -1){ + return 'mpeg' + } + + if(str.indexOf('.ogg') !== -1) { + return 'ogg' + } + + return false + }, + // check if item is object checkIfIsObject(itemIndex) { const item = this.items[itemIndex]