fregante / iphone-inline-video

📱 Make videos playable inline on the iPhone (prevents automatic fullscreen)
https://npm.im/iphone-inline-video
MIT License
2.05k stars 300 forks source link

it not works in vue.js #113

Closed lin-hun closed 7 years ago

lin-hun commented 7 years ago

my code like this,I use vue.js to init the dom(#app),the inline not work.

<div id="app" >
    <video  autoplay webkit-playsinline  playsinline class="video" id="video" poster="http://hbpic-10057247.file.myqcloud.com/char/431a457367f4888a92568985a06e4942.png" src="http://8520.liveplay.myqcloud.com/live/8520_16e49f48fa.m3u8">
    </video>
</div>
<script>
        new Vue({
              el: '#app',
                data: data,
                methods: methods
            })
</script>

when i tried move the video elem to out,it works.

<video  autoplay webkit-playsinline  playsinline class="video" id="video" poster="http://hbpic-10057247.file.myqcloud.com/char/431a457367f4888a92568985a06e4942.png" src="http://8520.liveplay.myqcloud.com/live/8520_16e49f48fa.m3u8">
    </video>
<div id="app" >
</div>
fregante commented 7 years ago

Vue probably replaces the element inside #app. You'll have to call enableInlineVideo after activating Vue