---
# System prepended metadata

title: Html5 video
tags: [video, HTML5]

---

# Html5 video

###### tags: `HTML5` `video`

```
<video id="my_video" width="800" controls style="padding-top:25px">
    <source id="my_source" src type="video/mp4">Your browser does not support the video tag.
</video>
```

## 遇到的問題：
再要動態改變src的時候，要注意路徑，vue框架會將路經解析成media/Ifttt.mp4，導致找不到片源黑屏的狀況，所以不要把影片放在vue裡面
```
const video = document.getElementById("my_video");

video.src = "/assets/video/Ifttt.mp4";  //路徑
video.load();
```
