1function stateChange(newState) {
2 setTimeout(function () {
3 if (newState == -1) {
4 alert('VIDEO HAS STOPPED');
5 }
6 }, 5000);
7}
8
1setTimeout(function () {
2 // ...
3 }, 10000);
4
5// or
6
7.then(() => {
8 // ...
9 ({ timeout: 10000 });
10 });
1timeout(ms) { //pass a time in milliseconds to this function
2 return new Promise(resolve => setTimeout(resolve, ms));
3 }