Spaces:
Runtime error
Runtime error
Commit
•
4a5a7e0
1
Parent(s):
826207d
add automatic reload of the whole pahe
Browse files- public/index.html +5 -10
public/index.html
CHANGED
@@ -29,13 +29,7 @@
|
|
29 |
player.on(mpegts.Events.ERROR, function (err) {
|
30 |
console.log('got an error:', err)
|
31 |
if (err.type === mpegts.ErrorTypes.NETWORK_ERROR) {
|
32 |
-
console.log('Network error
|
33 |
-
setTimeout(() => {
|
34 |
-
// Unload the current stream
|
35 |
-
player.unload()
|
36 |
-
// Load the stream again
|
37 |
-
player.load()
|
38 |
-
}, 500)
|
39 |
}
|
40 |
});
|
41 |
player.load()
|
@@ -45,9 +39,10 @@
|
|
45 |
setTimeout(() => {
|
46 |
console.log('Reloading the page..')
|
47 |
//Unloading and loading the source again
|
48 |
-
player.unload()
|
49 |
-
player.load()
|
50 |
-
|
|
|
51 |
}, false);
|
52 |
|
53 |
player.play()
|
|
|
29 |
player.on(mpegts.Events.ERROR, function (err) {
|
30 |
console.log('got an error:', err)
|
31 |
if (err.type === mpegts.ErrorTypes.NETWORK_ERROR) {
|
32 |
+
console.log('Network error')
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
});
|
35 |
player.load()
|
|
|
39 |
setTimeout(() => {
|
40 |
console.log('Reloading the page..')
|
41 |
//Unloading and loading the source again
|
42 |
+
// player.unload()
|
43 |
+
// player.load()
|
44 |
+
window.reload()
|
45 |
+
}, 1200)
|
46 |
}, false);
|
47 |
|
48 |
player.play()
|