H5 video as a background source src loop issue notes

Do one effect today, but have problems very egg pain, and finally resolved, thanks to the enthusiastic help of friends, so jot down notes, if other friends to help it! Demand: video as the page background, but to regular replacement of video video Precautions: 1, video's source html after replacing src, the method to execute load and play methods to play, although src otherwise changed, but does not play (thanks folrvu guidance)

html part:

<video :style="fixStyle" autoplay loop ref="videobox">
    <source :src="bgselect.src" :type="bgselect.type"/>
</video>

 

js part:

bg.video list to be recycled as a video
bgselect selected as a video source

 

data () {
            return {
                fixStyle: '',
                bg: {
                    image: '/static/images/bg.jpg',
                    video: [
                        {
                            src :'/static/video/bg4.mp4',
                            type: 'video/mp4'
                        },
                        {

  

Guess you like

Origin www.cnblogs.com/mahuateng/p/11870876.html