Skip to content

Commit 1aa5c35

Browse files
committed
Reto platzi#1 completo
1 parent 03288dd commit 1aa5c35

4 files changed

Lines changed: 1888 additions & 0 deletions

File tree

assets/index.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
* {
2+
-webkit-font-smoothing: antialiased;
3+
-moz-osx-font-smoothing: grayscale;
4+
box-sizing: border-box;
5+
}
6+
7+
body {
8+
background: #eeeeee;
9+
color: #030303;
10+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
11+
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
12+
}
13+
14+
header {
15+
text-align: center;
16+
padding: 3rem 0;
17+
background-image: linear-gradient(120deg, #f093fb 0%, #f5576c 100%);
18+
color: white;
19+
}
20+
21+
header > h1 {
22+
font-weight: normal;
23+
font-style: italic;
24+
}
25+
26+
main {
27+
padding: 1rem 0;
28+
}
29+
30+
.container {
31+
max-width: 960px;
32+
width: 100%;
33+
margin: 0 auto;
34+
}
35+
36+
.movie {
37+
width: 100%;
38+
}

index.html

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<html>
2+
<head>
3+
<title>PlatziMediaPlayer.js</title>
4+
<link
5+
rel="stylesheet"
6+
href="https://necolas.github.io/normalize.css/8.0.1/normalize.css"
7+
/>
8+
<link rel="stylesheet" href="./assets/index.css" />
9+
</head>
10+
11+
<body>
12+
<header>
13+
<h1>PlatziMediaPlayer.js</h1>
14+
<p>An extensible media player.</p>
15+
</header>
16+
17+
<main class="container">
18+
<video class="movie">
19+
<source src="./assets/ejercicio.mp4" />
20+
</video>
21+
22+
<button>Play/Pause</button>
23+
</main>
24+
<script>
25+
const video = document.querySelector("video");
26+
const button = document.querySelector("button");
27+
28+
function MediaPlayer(config){
29+
this.media = config.el;
30+
}
31+
MediaPlayer.prototype.play = function(){
32+
this.media.play();
33+
}
34+
MediaPlayer.prototype.pause = function(){
35+
this.media.pause();
36+
}
37+
//MediaPlayer.prototype.paused = this.media.paused;
38+
39+
const player = new MediaPlayer({el:video});
40+
button.onclick = () => {
41+
if(video.paused){
42+
player.play();
43+
}else{
44+
player.pause();
45+
}
46+
}
47+
</script>
48+
</body>
49+
</html>

0 commit comments

Comments
 (0)