@@ -210,7 +210,7 @@ class MusicPage extends Page {
|
||||
}
|
||||
|
||||
const store = useStore()
|
||||
const apiBase = process.env.VUE_APP_API_BASE as string
|
||||
const apiBase = import.meta.env.VUE_APP_API_BASE
|
||||
const { loading, modalLoading, total, search, setLoadData, loadDataBase, reset, pageChange, pageSizeChange } = useBaseList(new MusicPage())
|
||||
const currentRow = ref<MusicModel | null>(null)
|
||||
const libIdSelected = ref<string | null>(null)
|
||||
|
||||
@@ -105,7 +105,7 @@ class PhotoWallPage extends Page {
|
||||
}
|
||||
|
||||
const store = useStore()
|
||||
const apiBase = process.env.VUE_APP_API_BASE as string
|
||||
const apiBase = import.meta.env.VUE_APP_API_BASE
|
||||
const { loading, total, search, setLoadData, loadDataBase, reset, pageChange, pageSizeChange } = useBaseList(new PhotoWallPage())
|
||||
|
||||
const allowUploadExt = ['jpg', 'jpeg', 'png']
|
||||
|
||||
@@ -87,7 +87,7 @@ import { SourceImageModel } from '@/model/api/source-image'
|
||||
import http from '@/utils/http'
|
||||
|
||||
const store = useStore()
|
||||
const apiBase = process.env.VUE_APP_API_BASE as string
|
||||
const apiBase = import.meta.env.VUE_APP_API_BASE
|
||||
const { loading, total, search, setLoadData, pageChange, pageSizeChange, datetimeFormat } = useBaseList(new Page())
|
||||
|
||||
const allowUploadExt = ['jpg', 'jpeg', 'png', 'svg', 'ico']
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps<{type: string}>()
|
||||
const requireAssets = require.context('../assets', false, /\.svg$/)
|
||||
const SVGs = requireAssets.keys().reduce((svgs: {[propName:string]: string}, path: string) => {
|
||||
const svgFile = requireAssets(path)
|
||||
const svgModules = import.meta.glob('../assets/*.svg', { eager: true, import: 'default' }) as Record<string, string>
|
||||
|
||||
const SVGs = Object.entries(svgModules).reduce((svgs: {[propName:string]: string}, [path, svgFile]) => {
|
||||
const fileNameMatch = path.match(/^.*\/(.+?)\.svg$/)
|
||||
if (fileNameMatch) {
|
||||
svgs[fileNameMatch[1]] = svgFile
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
import MusicList from './components/aplayer-list.vue'
|
||||
import Controls from './components/aplayer-controller.vue'
|
||||
import Lyrics from './components/aplayer-lrc.vue'
|
||||
import Hls from 'hls.js'
|
||||
import { warn } from './utils'
|
||||
|
||||
// mutex playing instance
|
||||
@@ -667,20 +668,14 @@
|
||||
if (this.audio.canPlayType('application/x-mpegURL') || this.audio.canPlayType('application/vnd.apple.mpegURL')) {
|
||||
this.audio.src = src
|
||||
} else {
|
||||
try {
|
||||
const Hls = require('hls.js')
|
||||
if (Hls.isSupported()) {
|
||||
if (!this.hls) {
|
||||
this.hls = new Hls()
|
||||
}
|
||||
this.hls.loadSource(src)
|
||||
this.hls.attachMedia(this.audio)
|
||||
} else {
|
||||
warn('HLS is not supported on your browser')
|
||||
this.audio.src = src
|
||||
if (Hls.isSupported()) {
|
||||
if (!this.hls) {
|
||||
this.hls = new Hls()
|
||||
}
|
||||
} catch (e) {
|
||||
warn('hls.js is required to support m3u8')
|
||||
this.hls.loadSource(src)
|
||||
this.hls.attachMedia(this.audio)
|
||||
} else {
|
||||
warn('HLS is not supported on your browser')
|
||||
this.audio.src = src
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user