username@email.com
2024-10-29 a5851a4e906725b868bcfdaa8c59249523137586
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<template>
    <view class="video coreshop-margin-left-10 coreshop-margin-right-10  coreshop-margin-bottom-10">
        <video class="videoCT" id="myVideo" :src="coreshopData.parameters.list[0].url" :autoplay="autoplay" :poster="coreshopData.parameters.list[0].image"></video>
    </view>
</template>
 
<script>
    export default {
        name: "coreshopVideo",
        props: {
            coreshopData: {
                type: Object,
                required: true,
            }
        },
        data() {
            return {
                autoplay: false
            }
        },
        created() {
            if (this.coreshopData.parameters.autoplay == 'true' || this.coreshopData.parameters.autoplay == true) {
                this.autoplay = true;
            }
 
        },
        onReady: function (res) {
            // #ifndef MP-ALIPAY
            this.videoContext = uni.createVideoContext('myVideo')
            // #endif
        },
        methods: {
 
        }
    }
</script>
 
<style lang="scss" scoped>
    .video { border-radius: 8px;
        .videoCT { width: 100%; min-height: 100px; }
    }
</style>