javascript - “currentTime”音频属性不适用于我的安卓手机
问题描述
“currentTime”音频属性不适用于我的安卓手机。当我使用句子“aud.currentTime=30”时,这会返回到位置0。示例:
<html>
<body>
<button onclick="getCurTime()" type="button">Get current time position</button>
<button onclick="setCurTime()" type="button">Set time position to 30 seconds</button><br> <br><br>
<audio d="myAudio" controls>
<source src="https://suarezfco65.github.io/amobiodanza/IBFC21 - 18 - OST Metello (Morricone, Ennio) - Metello.mp3" type="audio/mpeg">
Your browser does not support HTML5 audio.
</audio>
<script>
var aud = document.getElementById("myAudio");
alert("Inicio");
function getCurTime() {
alert(aud.currentTime);
}
function setCurTime() {
aud.currentTime=30;
}
</script>
</body>
</html>
解决方案
推荐阅读
- python - 避免进行多次 Django 数据库调用
- java - 如何处理使用 Java JDI 调试的 Java 控制台应用程序的输入?
- c - 谁能解释这一点并交换“ printf("n=%**d\n", n, l);" 并解释它是如何工作的?我尝试一下并打印 *d=n
- javascript - 关于字符串构建的 TypeScript 语法问题
- vue.js - 是否可以只导入 vue 组件的一部分?
- java - 由于 Android 消息“查看全屏,要退出,请从顶部向下滑动”,Espresso 测试失败
- spring-boot - 由于 Spring 引导版本升级到 2.3.1,Spring 数据 cassandra 出现问题
- api - 是否有用于 vimeo 展示的 API 端点,可让您在展示中嵌入特定视频,包括播放列表?
- c# - 使用 asp net core 序列化 JSON 中的大对象
- sql - 如果我们在 sql developer 中有 1 天范围内的日期,如何选择行