JavaScript - Reproductor Multimedia

 
Vista:

Reproductor Multimedia

Publicado por Angel (2 intervenciones) el 22/05/2017 08:37:13
Hola buenas, No encuentro el error en el siguiente código. Las funciones deberian de reproducir, ocultar el boton seleccionado y mostrar el boton oculto.

Gracias.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
 
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
 
    <script>
        var vid = document.getElementById("myVideo");
 
        function setUpVolume() {
            myVideo.volume = 0.9;
        }
 
        function setDownVolume() {
            myVideo.volume = 0.1;
        }
 
 
        function hide(obj) {
 
            var el = document.getElementById(obj);
            el.style.display = 'none';
            myVideo.play();
 
 
        }
 
        function show(obj2) {
 
            var la = document.getElementById(obj2);
            la.style.display = 'inline';
            alert('Mis pelotas mamones');
        }
 
        function hide2(obj3) {
 
            var el2 = document.getElementById(obj3);
            el2.style.display = 'none';
            myVideo.stop();
 
        }
 
        function show2(obj4) {
            var la2 = document.getElementById(obj4);
            la2.style.display = 'inline !important';
        }
 
    </script>
 
 
</head>
 
 
 
<body>
 
 
    <a onClick="hide('play'); show('pausa')"><span id='play' class="glyphicon glyphicon-play"></span></a>
 
    <a onclick="hide2('pausa'); show2('play')" style="display:none;"> <span id="pausa" class="glyphicon glyphicon-pause"></span></a>
 
 
    <a onclick="setDownVolume()">
        <span class="glyphicon glyphicon-volume-down"></span>
    </a>
 
    <a onclick="setUpVolume()">
        <span class="glyphicon glyphicon-volume-up"></span>
    </a>
    <br>
 
    <video id="myVideo" width="320" height="176">
  <source src="pr.mp4" type="video/mp4">
  <source src="pr.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>
 
</body>
 
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Reproductor Multimedia

Publicado por Angel (2 intervenciones) el 22/05/2017 09:58:16
He encontrado el fallo, aquí tenéis la solución
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function hide(obj) {
 
    var el = document.getElementById(obj);
    el.style.display = 'none';
    myVideo.play();
 
 
}
 
function show(obj2) {
 
    var la = document.getElementById(obj2);
    la.style.display = 'inline';
}
 
function hide2(obj3) {
 
    var el2 = document.getElementById(obj3);
    el2.style.display = 'none';
    myVideo.pause();
 
}
 
function show2(obj4) {
    var la2 = document.getElementById(obj4);
    la2.style.display = 'inline';
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar