当前位置:网站首页>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>
边栏推荐
- 学习太极创客 — MQTT(五)发布、订阅和取消订阅
- Utonmos: digital collections help the inheritance of Chinese culture and the development of digital technology
- 上传文件/文本/图片,盒子阴影
- Scratch returns 400
- Is it safe for Caicai securities to open an account in 2022?
- Kotlin quick start
- usb peripheral 驱动 - 枚举
- kotlin快速上手
- Arthas(阿尔萨斯) 能为你做什么?
- 解析少儿编程的多元评价体系
猜你喜欢
使用IDEA画结构图
Deletelater Usage Summary in QT
Using meta analysis to drive the development of educational robot
工作室第3次HarmonyOS培训笔记
Group counting notes - instruction pipeline of CPU
On virtual memory and oom in project development
Problems encountered in project deployment - production environment
[hash table] a very simple zipper hash structure, so that the effect is too poor, there are too many conflicts, and the linked list is too long
todolist未完成,已完成
经典模型——ResNet
随机推荐
Analysis on the diversification of maker space mechanism construction
计组笔记 数据表示与运算 校验码部分
ArrayList#subList这四个坑,一不小心就中招
MySQL增删查改(进阶)
Worm copy construction operator overload
Stm32cubemx: watchdog ------ independent watchdog and window watchdog
golang正則regexp包使用-06-其他用法(特殊字符轉換、查找正則共同前綴、切換貪婪模式、查詢正則分組個數、查詢正則分組名稱、用正則切割、查詢正則字串)
Qt 中 deleteLater 使用总结
On virtual memory and oom in project development
[QT] custom control - air quality dashboard
【论文笔记】Learning to Grasp with Primitive Shaped Object Policies
解析少儿编程的多元评价体系
Google recommends using kotlin flow in MVVM architecture
2021-08-04
Clion项目中运行多个main函数
类图
Good news | congratulations on the addition of 5 new committers in Apache linkage (incubating) community
上传文件/文本/图片,盒子阴影
使用IDEA画结构图
多媒体元素,音频、视频