【问题标题】:Video doesn't start playing anymore视频不再开始播放
【发布时间】:2017-06-02 11:48:32
【问题描述】:

我正在创建一个网站,我必须单击一个按钮才能打开视频。它以前可以工作,但现在已经不行了。我是否不小心删除或更改了某些内容?

这是我的代码:

HTML:

textbela.style.opacity=0;
av1.onmouseover = function(){
  TweenMax.to (textbela,0.69,{opacity:1})
  TweenMax.to (vid1,0.66,{height:"100%"})
}

av1.onmouseout = function(){
  TweenMax.to (textbela,0.69,{opacity:0})
  TweenMax.to (vid1,1,{height:"10%"})
}

av1.onclick = function(){
  TweenMax.to ($(".button"),1,{opacity:0,onComplete:fct})
  function fct (){
    vid.style.display="block"
    vid.play();
  }
}
#av1{
  position:absolute;
  left:5%;
  background:url(previews/av1.jpg) 70% 50%;
  background-size:cover;
  height: 40%;
  width: 40%;
  border: solid;
  border-width: 2px;
  border-color: #000;
}

#vid1{
  position:absolute;
  top:0;
  background-color: #000;
  height: 25px;
  width: 100%;
}

#vid1 p{
  color:#F3EBEB;
  font-size:16px;
  text-align:center;
  margin-top:0px;
}

#vid {
  display:none;
  position:absolute;
  height:90%;
  width:100%;
}

#av1:hover{
  cursor: pointer;
}

#av1:hover #textbela{
  color: white;
  transition-delay: 0.7s;
  transition: 0.69s;
}

#textbela{
  font-family: avenir light;
  font-size: 16px;
  color: transparent;
  text-align: center;
}
<video id="vid">
  <source src="Bela Lugosi's Dead.mp4" type="video/mp4">
</video>

<div class="button">
    <div id="av1">
        <div id="vid1">
            <p>Bela Lugosi's Dead</p>
            <div id="textbela">J’ai réalisé le clip de la chanson “Bela Lugosi’s Dead”  de Bauhaus. La chanson parle de Bela Lugosi, l’acteur ayant incarné Dracula pour la première fois dans le film de 1931.</div>
        </div>
    </div>
</div>

感谢您的帮助!

【问题讨论】:

    标签: javascript html css video gsap


    【解决方案1】:

    “我是否不小心删除或更改了某些内容?”所有迹象都指向“是”。

    (您从未在 av1.onclick 中定义“vid”;可能您曾经在其中有一个 var vid = $('#vid')。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-04
      • 2020-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多