当前位置:网站首页>Multimedia elements, audio, video
Multimedia elements, audio, video
2022-06-26 03:22:00 【Small vegetable bird yard live】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Multimedia elements </title>
<style>
*{
padding: 0;
margin: 0;
}
#music{
position: fixed;
right: 0;
top: 0;
}
</style>
</head>
<body>
<!-- Inline elements / Block-level elements -->
<img id="music" src="img/musicBtn.png" alt="">
<div>
<audio id="aud" autoplay src="img/img/2.ogg" loop></audio>
<button id="btn"> Pause </button>
</div>
<video autoplay src="img/img/1.ogg" controls></video>
<script>
var btn = document.getElementById('btn');
var aud = document.getElementById('aud');
var music = document.getElementById('music');
music.onclick = function(){
if(aud.paused){
aud.play();
this.src = 'img/musicBtn.png';
}else{
aud.pause();
this.src = 'img/musicBtnOff.png';
}
}
var flag = true;// Set a flag ;
btn.onclick = function(){
if(flag){
aud.pause();
btn.innerHTML = ' Start ';
}else{
aud.play();
btn.innerHTML = ' Pause ';
}
flag = !flag;
}
</script>
</body>
</html>

边栏推荐
- Graphics card, GPU, CPU, CUDA, video memory, rtx/gtx and viewing mode
- Using meta analysis to drive the development of educational robot
- Preparation for wechat applet development
- golang正则regexp包使用-06-其他用法(特殊字符转换、查找正则共同前缀、切换贪婪模式、查询正则分组个数、查询正则分组名称、用正则切割、查询正则字串)
- 路由跳转之点击列表的操作按钮,跳转至另一个菜单页面并激活相应的菜单
- Record a torture bug caused by restcontrol and controller
- 如何筹备一场感人的婚礼
- Lumen Analysis and Optimization of ue5 global Lighting System
- Qt编译出错ERROR: Unknown module(s) in QT: script
- Utonmos: digital collections help the inheritance of Chinese culture and the development of digital technology
猜你喜欢
随机推荐
Preparation for wechat applet development
Learn from Taiji makers - mqtt (V) publish, subscribe and unsubscribe
校园创客空间的硬件造物原理
ArrayList # sublist these four holes, you get caught accidentally
Question about SQL: SQL question -- SQL code for multiple account logins
培育项目式Steam教育理念下的儿童创造力
用元分析法驱动教育机器人的发展
上传文件/文本/图片,盒子阴影
js array数组json去重
Classic quotations from "human nature you must not know"
Deletelater Usage Summary in QT
Stm32cubemx: watchdog ------ independent watchdog and window watchdog
解析少儿编程的多元评价体系
国信金太阳靠谱吗?开证券账户安全吗?
Scratch returns 400
Butterknife unbinder uses flashback in fragment and viewpager
What can Arthas do for you?
jupyter notebook的插件安装以及快捷键
Notes on the 3rd harmonyos training in the studio
[system architecture] - how to evaluate software architecture









