背景视频不会在现场播放,仅在本地播放

时间:2014-10-03 17:18:52

标签: html video background

更新:在我在浏览器中预览我的作品时在本地。我的文件存储在我们的某个服务器上的相同文件夹结构中。

更新:你指的是哪个jpeg引用?这是在我尝试这样做之前吗?

更新:此页面未加载评论或答案,因此我将在此处发布我的答案。

更新:控制台确实说文件丢失了,但它们不是。整个站点文件已上载多次。如果需要,我可以提供服务器内的文件夹的屏幕截图。

enter image description here

我在索引页面中插入了一个背景视频,但一旦网站上线,它就无法播放。我相信它使用图像后备。它在本地工作正常,但有绝对网址的问题。我从github下载了这个,这个问题的更新如下,但我下载的软件包仍然是一个新版本。测试链接位于github链接下方。

https://github.com/VodkaBears/Vide/archive/0.1.1.zip#

http://bit.ly/1xLpFiu

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Pragma" content="no_cache" />
<title>M&amp;T Printing Group</title>
<link rel=”author” href=”https://plus.google.com/+MTPrintingGroupKitchener“/>
<link href='http://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Bitter' rel='stylesheet' type='text/css' />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="css/ie7.css">
<![endif]-->
<link rel="stylesheet" type="text/css" href="css/content.css" />
<link rel="stylesheet" type="text/css" href="css/font.css" />
<link rel="stylesheet" type="text/css" href="QuotesRotator/css/default.css" />
<link rel="stylesheet" type="text/css" href="QuotesRotator/css/component.css" />
<script src="QuotesRotator/js/modernizr.custom.js" type="text/javascript"></script>
<!-- github.com/scottjehl/Respond - for IE 8, 7.... -->
<script src="Respond-master/dest/respond.min.js" type="text/javascript"></script>

<!--<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript">

$(document).ready(function(){
    $(".subnav").prev().mouseover(function(){
        var sub_menu_shift = parseInt($(this).next().css("height")) + 100;
        $(this).next().css({'position':'relative','bottom':sub_menu_shift});
    });
    });

</script>-->

    <style>
        html, body {
            margin: 0;
            width: 100%;
            height: 100%;
        }
    </style>

</head>

<body data-vide-bg="Vide-0.1.2/examples/video/videoMain">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="Vide-0.1.2/src/jquery.vide.js"></script>
<script>window.jQuery || document.write('<script src="Vide-0.1.2/libs/jquery/jquery-1.11.1.min.js"><\/script>')</script>
<script src="Vide-0.1.2/src/jquery.vide.js"></script>
<script>
//    $(document).ready(function () {
//        $(document.body).vide("Vide-0.1.2/examples/video/videoMain"); // Non declarative initialization
//
//        var instance = $(document.body).data("vide"); // Get instance
//        var video = instance.getVideoObject(); // Get video object
//        instance.destroy(); // Destroy instance
//    });
</script>

<div id="indexBG">

<div id="colour-bar-black"></div> <!-- colour-bar-black -->

<div id="nav-wrap">

<ul>
    <li id="link-one" class="orange">
    <a href="printing.html" class="parent-one-link" title="Printing"><span>Printing</span></a>

     <div class="subnav" id="subnav">
          <ul>
            <li><a href="_printing/digital-printing.html" title="Digital Printing">Digital Printing</a></li>
            <li><a href="_printing/offset-printing.html" title="Offset Printing">Offset Printing</a></li>
            <li><a href="_printing/business-cards&amp;stationery.html" title="Business Cards &amp; Stationery">Business Cards &amp; Stationery</a></li>
            <li><a href="_printing/manuals-reports&amp;catalogues.html" title="Manuals, Reports &amp; Catalogues">Manuals, Reports &amp; Catalogues</a></li>
            <li><a href="_printing/bindery-services.html" title="Bindery Services">Bindery Services</a></li>
            <li><a href="_printing/canada-post.html" title="Canada Post">Canada Post</a></li>
            <li><a href="_printing/graphic-design-typesetting.html" title="Graphic Design &amp; Typesetting">Graphic Design &amp; Typesetting</a></li>
          </ul>
        </div><!-- /.subnav -->

    </li>

    <li class="red"><a href="promotional-products.html" title="Promotional Products"><span class="doubleLine">Promotional Products</span></a>

    <div class="subnav">
          <ul>
            <li><a href="_promotional-products/awards-mounting.html" title="Awards &amp; Mounting">Awards &amp; Mounting</a></li>
            <li><a href="_promotional-products/binders.html" title="Binders">Binders</a></li>
            <li><a href="_promotional-products/clothing-apparel.html" title="Clothing &amp; Apparel">Clothing &amp; Apparel</a></li>
            <li><a href="_promotional-products/bags.html" title="Bags">Bags</a></li>
            <li><a href="_promotional-products/drinkware.html" title="Drinkware">Drinkware</a></li>
            <li><a href="_promotional-products/lanyards.html" title="Lanyards">Lanyards</a></li>
            <li><a href="_promotional-products/magnets.html" title="Magnets">Magnets</a></li>
            <li><a href="_promotional-products/pens-writing-instruments.html" title="Pens &amp; Writing Instruments">Pens &amp; Writing Instruments</a></li>
            <li><a href="_promotional-products/presentation-folders.html" title="Presentation Folders">Presentation Folders</a></li>
            <li><a href="_promotional-products/usb.html" title="USB Flash Drives">USB Flash Drives</a></li>
            <li><a href="_promotional-products/umbrellas.html" title="Umbrellas">Umbrellas</a></li>
          </ul>
        </div><!-- /.subnav -->

    </li>

    <li class="pink"><a href="banners-signage.html" title="Banners &amp; Signage"><span class="doubleLine">Banners &amp; Signage</span></a>

    <div class="subnav">
          <ul>
            <li><a href="_banners-signage/drafting-cad-services.html" title="Drafting &amp; CAD services">Drafting &amp; CAD services</a></li>
            <li><a href="_banners-signage/coroplast&amp;foamcore.html" title="Coroplast &amp; FoamCore">Coroplast &amp; FoamCore</a></li>
            <li><a href="_banners-signage/retractable-banners.html" title="Retractable Banners">Retractable Banners</a></li>
            <li><a href="_banners-signage/posters&amp;banners.html" title="Posters &amp; Banners">Posters &amp; Banners</a></li>
            <li><a href="_banners-signage/wraps&amp;pvc.html" title="Wraps &amp; PVC">Wraps &amp; PVC</a></li>
            <li><a href="_banners-signage/displays&amp;canvas.html" title="Displays &amp; Canvas">Displays &amp; Canvas</a></li>
          </ul>
        </div><!-- /.subnav -->

    </li>

    <li class="purple"><a href="pool.html" title="POOL"><span>POOL</span></a></li>

    <li class="blue"><a href="http://www.volumesdirect.com/" title="Volumes"><span>Volumes</span></a></li>

    <li class="green"><a href="contact.html" title="Contact"><span>Contact</span></a>

    <div class="subnav">
          <ul>
            <li><a href="locations.html" title="Locations">Locations</a></li>
            <li><a href="media.html" title="Media">Media</a></li>
            <li><a href="https://digitalink2.mtprint.com/exchweb/bin/auth/owalogon.asp?url=https://digitalink2.mtprint.com/exchange&reason=0&replaceCurrent=1" title="Digital Link">Digital Link</a></li>
            <li><a href="ftp://ftp.mtprint.com/" title="FTP site">FTP site</a></li>
            <li><a href="https://secure.mtprint.com/pool/CustSignIn.aspx" title="Client Login">Client Login</a></li>
            <li><a href="mtprint/QuoteForm.aspx" title="Estimate Request">Estimate Request</a></li>
            <li><a href="submit/submit_file.aspx" title="Submit A File">Submit A File</a></li>
            <li><a href="_contact/recognition.html" title="Recognition">Recognition</a></li>
            <li><a href="_contact/graphics-factory.html" title="Graphics Factory">Graphics Factory</a></li>
            <li><a href="_contact/careers.html" title="Careers">Careers</a></li>
          </ul>
        </div><!-- /.subnav -->

    </li>

    <li class="yellow-facebook"><a href="https://www.facebook.com/mtprint/" title="Facebook"><span></span></a></li>

</ul>

</div> <!-- nav-wrap -->

<div id="logo"><a href="index.html"><img src="images/logo-main.png" alt="M&amp;T Printing Group" title="M&amp;T Printing Group" /></a></div> <!-- logo -->

<!-- used for mobile -->

<div id="logo-mobile"><a href="index.html"><img src="images/M&T-Printing-Group-Logo-moble.jpg" alt="M&amp;T Printing Group" title="M&amp;T Printing Group" /></a></div> <!-- logo-mobile -->

<h1>&ldquo;Your Partners In Print&rdquo;</h1>

<div id="footer">        

<ul class="footer-left">
    <li><a href="index.html">M&amp;T Printing Group</a> - &copy; 2014</li>
</ul>

<ul class="footer-right">
 <li><a href="https://secure.mtprint.com/pool/CustSignIn.aspx" title="Client Login">Client Login</a></li>
 <li><a href="locations.html" title="Locations">Locations</a></li>
 <li><a href="pool.html" title="Pool">Pool</a></li>
</ul>

</div> <!-- footer -->   

</div> <!-- indexBG -->

</body>
</html>

1 个答案:

答案 0 :(得分:0)

我会使用jquery做这样的事情。您可以将videoURL转到任何您喜欢的地方,它会立即加载。我过去已经为几个网站做过这个,它的工作非常好。以下只是html和JQUERY。在我看来你的问题似乎是你存储了视频。你说它工作得很好“本地”你在哪里托管你的网页?您的视频应存储在同一地点。

<section class="content-section video-section">
   <div class="pattern-overlay">
    <a id="bgndVideo" class="player" data-property="{videoURL:'https://www.youtube.com/watch?v=sd4bqmP_460',containment:'', quality:'large', autoPlay:true, mute:true, opacity:1}">bg</a>
    </div>
</section>


$(document).ready(function () {

    $(".player").mb_YTPlayer();

});

我看到你添加的编辑。删除jpeg或引用mp4文件。

- 很抱歉编辑你的评论,但这是我能回应的唯一方式。你的意思是jpeg参考吗?