简体   繁体   English

无法在我的网站中添加视频

[英]Unable to add video in my website

Some problem with the width and height, it shows up on the full page . 宽度和高度有些问题,它显示在整页上。 Also my video is working on firefox but not on chrome 另外我的视频在Firefox上运行,但在chrome上不行

<div id="videoTop" style="position:fixed;  right: 0px; min-width: 100%; min-height: 50%; width: auto; height: auto; z-index: 1; overflow:hidden;">

    <script>
        if (jQuery.browser.mobile) {
            $('div#videoTop').remove();
        }
        else { }
    </script>

    <video id="videoBG" preload="auto" autoplay="autoplay" loop="loop" muted="muted" volume="0" tabindex="0" style="position: fixed;  right: 0px; min-width: 100%; min-height: 30%; width: auto; height: auto; z-index: -2; overflow: hidden;">
        <source src="Images/Wildlife.mp4" type="video/mp4" codecs="&quot;avc1.42E01E, mp4a.40.2&quot;">
        <source src="/assets/1550/allure-homepage.webm" type="video/webm; codecs=&quot;vp8, vorbis&quot;">
    </video>
</div>

如果== true,则将删除已发布的整个标记块。

Your jQuery code will remove the entire block when true since there's only 1 <div> tag. 由于只有1个<div>标签,因此您的jQuery代码将为true时将删除整个块。 Is that what you want, and is mobile browsers where you're encountering the error? 那是您想要的吗,移动浏览器是您遇到错误的地方吗?

For non-mobile browsers, try removing the codecs, which aren't usually necessary & which appear to include unnecessary quotation marks and semi-colons that are breaking your code above. 对于非移动浏览器,请尝试删除编解码器,这些编解码器通常不是必需的,并且似乎包含不必要的引号和分号,它们破坏了上面的代码。

 <video id="videoBG" preload="auto" loop="loop" muted="muted" volume="0" tabindex="0" style="position: fixed; right: 0px; min-width: 100%; min-height: 30%; width: auto; height: auto; z-index: -2; overflow: hidden;">
     <source src="Images/Wildlife.mp4" type="video/mp4">
     <source src="/assets/1550/allure-homepage.webm" type="video/webm">
 </video>

If not that, confirm your file paths to the videos. 如果不是这样,请确认视频的文件路径。 Why are they totally different videos and different subfolders ("Images" vs "assets") for different browsers? 为什么它们针对不同的浏览器完全不同的视频和不同的子文件夹(“图像”与“资产”)?
Finally, is there other content? 最后,还有其他内容吗? Why z-index of -2? 为什么Z索引为-2? Could something else be covering the video? 影片中还有其他内容吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM