Created
July 13, 2012 07:21
-
-
Save siddharta1337/3103332 to your computer and use it in GitHub Desktop.
Prueba audio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2" /> | |
<title>Ejercicio 2.7</title> | |
<meta charset="utf-8"> | |
<style> | |
button { | |
background: green; | |
border-radius: 10px; | |
font-size: 1em; | |
margin: 4%; | |
padding: 1em; | |
width: 40%; | |
} | |
button:last-of-type { | |
background: red; | |
} | |
</style> | |
</head> | |
<body> | |
<audio id="miAudio" src="http://carlossolis.mobi/cursos/audio.mp3"></audio> | |
<button onClick="reproducir()"> reproducer </button> | |
<button onClick="detener()"> detener </button> | |
<script> | |
function reproducir(){ | |
var audio = document.getElementById("miAudio"); | |
audio.play(); | |
} | |
function detener(){ | |
var audio = document.getElementById("miAudio") | |
audio.pause(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment