<script setup>
import { ref, reactive } from 'vue'

const show = defineModel('show', { type: Boolean, default: false })
const props = defineProps({
    title:{
        type:String,
        default:''
    },
    mediaType:{
        type:String,
        default:'audio'
    },
    src:{
        type:String,
        default:''
    },
})
</script>

<template>
    <el-dialog v-model="show" :title="props.title" width="1100px" draggable destroy-on-close>
        <div class="content-wrap">
            <div class="audio-wrap" v-if="props.mediaType==='audio'">
                <audio style="width: 100%;outline: none;"
                    controls autoplay :src="props.src"></audio>
            </div>
            <div class="video-wrap" v-if="props.mediaType==='video'">
                <video style="width: 100%;height: 100%;max-height: 70vh;outline: none;" 
                    controls :src="props.src" autoplay>
                    您的浏览器暂不支持,请更换浏览器
                </video>
            </div>
        </div>
    </el-dialog>
</template>

<style scoped lang="scss">
.content-wrap{
    padding-bottom: 40px;
}
</style>
