Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 650fbde

Browse files
committed
course wesbos#11 not interested
1 parent dae9bf8 commit 650fbde

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

11 - Custom Video Player/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99

1010
<div class="player">
11-
<video class="player__video viewer" src="https://player.vimeo.com/external/194837908.sd.mp4?s=c350076905b78c67f74d7ee39fdb4fef01d12420&profile_id=164"></video>
11+
<video class="player__video viewer" src="http://124.14.5.154/sports.tc.qq.com/s0022yajnm0.p403.1.mp4?sdtfrom=v1010&guid=cdb2771e5bbedac4b63577dcfc352c1b&vkey=34D9E79337B71F3FA7ECB9E27C2FAEFB61529155212847B9718964E78C65DE849884A9E7EC2024D6B7DD8296FAE97469F927EB13DFFAA0374DEFDC1F8C2FCA5E5AF1B833FE7737C17A7486AF15BAE6CF3D50219B82604902&locid=3d6c2f42-6631-45f6-8aa6-1e33eb692b1a&size=7391799&ocid=458364332"></video>
1212

1313
<div class="player__controls">
1414
<div class="progress">

11 - Custom Video Player/scripts.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const vdo = document.querySelector('.player__video');
2+
let vdo_play = false;
3+
vdo.addEventListener('canplay', canPlay, false);
4+
5+
function canPlay() {
6+
document.querySelector('.player__button')
7+
.addEventListener('click', e => {
8+
if(!vdo_play){
9+
vdo.play();
10+
vdo_play = true;
11+
}
12+
else{
13+
vdo.pause();
14+
vdo_play = false;
15+
}
16+
}, false)
17+
}

0 commit comments

Comments
 (0)