Html盛放媒体/视频标签

播放视频:

<video id="video1" width="420" style="margin-top:15px;"  controls="controls" autoplay="autoplay">
    <source src="@Model.VideoUrl" type="video/mp4" />
    Your browser does not support HTML5 video.
</video>
<script type="text/javascript">
    var myVideo = document.getElementById("video1");

    function playPause() {
        if (myVideo.paused)
            myVideo.play();
        else
            myVideo.pause();
    }

    function makeBig() {
        myVideo.width = 560;
    }

    function makeSmall() {
        myVideo.width = 320;
    }

    function makeNormal() {
        myVideo.width = 420;
    }
</script> 
<a href="@Model.VideoUrl">点击开始播放视频</a>
@Model.VideoUrl:视频的地址
controls="controls" autoplay="autoplay":

 

posted @ 2018-05-30 11:48  紫晶城  阅读(144)  评论(0编辑  收藏  举报