相关疑难解决方法(0)

如何检测Safari,Chrome,IE,Firefox和Opera浏览器?

我有FF,Chrome,IE,Opera和Safari的5个插件/扩展.

如何识别用户浏览器并重定向(单击安装按钮后)以下载相应的插件?

javascript browser-detection

738
推荐指数
17
解决办法
78万
查看次数

单击HTML 5视频元素播放,暂停视频,中断播放按钮

我正在尝试让视频像YouTube一样播放和暂停(使用播放和暂停按钮,然后单击视频本身.)

<video width="600" height="409" id="videoPlayer" controls="controls">
 <!-- MP4 Video -->
 <source src="video.mp4" type="video/mp4">
</video>


<script>
    var videoPlayer = document.getElementById('videoPlayer');

    // Auto play, half volume.
    videoPlayer.play()
    videoPlayer.volume = 0.5;

    // Play / pause.
    videoPlayer.addEventListener('click', function () {
        if (videoPlayer.paused == false) {
            videoPlayer.pause();
            videoPlayer.firstChild.nodeValue = 'Play';
        } else {
            videoPlayer.play();
            videoPlayer.firstChild.nodeValue = 'Pause';
        }
    });
</script>
Run Code Online (Sandbox Code Playgroud)

你有什么想法会破坏播放和暂停控制按钮吗?

youtube video html5

31
推荐指数
5
解决办法
15万
查看次数

Html5视频 - 在屏幕上点击播放/暂停视频

,嗨,

    <!DOCTYPE html> 
<html> 
<body> 

<div style="text-align:center"> 
  <button onclick="playPause()">Play/Pause</button> 
  <button onclick="makeBig()">Big</button>
  <button onclick="makeSmall()">Small</button>
  <button onclick="makeNormal()">Normal</button>
  <br> 
  <video id="video1" width="420">
    <source src="mov_bbb.mp4" type="video/mp4">
    <source src="mov_bbb.ogg" type="video/ogg">
    Your browser does not support HTML5 video.
  </video>
</div> 

<script> 
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> 

<p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body> 
</html>
Run Code Online (Sandbox Code Playgroud)

我尝试使用来自以下网站的html5视频

http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_video_js_prop

如何在视频屏幕上播放/暂停视频?

任何帮助将不胜感激.

谢谢.

javascript video jquery html5 screen

5
推荐指数
1
解决办法
3万
查看次数

标签 统计

html5 ×2

javascript ×2

video ×2

browser-detection ×1

jquery ×1

screen ×1

youtube ×1