Skip to content

Commit c850262

Browse files
committed
feat: update noVNC to v1.1.0, flv.js to v1.5.0
1 parent 5e9ff11 commit c850262

File tree

6 files changed

+111
-91
lines changed

6 files changed

+111
-91
lines changed

Dockerfile.amd64

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /bin/
5151
RUN chmod +x /bin/tini
5252

5353
# ffmpeg
54-
RUN mkdir -p /usr/local/ffmpeg \
55-
&& curl -sSL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar xJvf - -C /usr/local/ffmpeg/ --strip 1
54+
RUN apt update \
55+
&& apt install -y --no-install-recommends --allow-unauthenticated \
56+
ffmpeg \
57+
&& rm -rf /var/lib/apt/lists/* \
58+
&& mkdir /usr/local/ffmpeg \
59+
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg
5660

5761
# python library
5862
COPY image/usr/local/lib/web/backend/requirements.txt /tmp/

Dockerfile.j2

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-{{arc
7272
RUN chmod +x /bin/tini
7373

7474
# ffmpeg
75-
RUN mkdir -p /usr/local/ffmpeg \
76-
&& curl -sSL https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz | tar xJvf - -C /usr/local/ffmpeg/ --strip 1
75+
RUN apt update \
76+
&& apt install -y --no-install-recommends --allow-unauthenticated \
77+
ffmpeg \
78+
&& rm -rf /var/lib/apt/lists/* \
79+
&& mkdir /usr/local/ffmpeg \
80+
&& ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg
81+
7782

7883
# python library
7984
COPY image/usr/local/lib/web/backend/requirements.txt /tmp/

web/static/novnc

Submodule novnc updated 109 files

web/static/scripts/flv.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/static/video.html

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</head>
3333
<body>
3434
<div id="mainContainer" class="mainContainer">
35-
<video name="videoElement" class="centeredVideo" autoplay width="1024" height="576">
35+
<video name="videoElement" class="centeredVideo" width="1024" height="576">
3636
Your browser is too old which doesn't support HTML5 video.
3737
</video>
3838
<br>
@@ -63,21 +63,38 @@
6363
//flv_load();
6464
var videoElement = document.getElementsByName('videoElement')[0];
6565
flvPlayer = flvjs.createPlayer({
66-
type: 'flv',
67-
url: url,
68-
isLive: true,
69-
withCredentials: true
70-
}, {isLive: true, enableStashBuffer: false});
66+
type: 'flv',
67+
url: url,
68+
isLive: true,
69+
withCredentials: true
70+
}, { isLive: true, enableStashBuffer: false });
7171
flvPlayer.attachMediaElement(videoElement);
7272
flvPlayer.load();
73-
flvPlayer.play();
74-
flvPlayer.on("error", function() {
73+
function f() {
74+
try {
75+
// flvPlayer.play();
76+
var playPromise = videoElement.play();
77+
if (playPromise !== undefined) {
78+
playPromise.then(_ => {
79+
console.log("play successfully");
80+
}).catch(error => {
81+
// console.log(error);
82+
setTimeout(f, 10)
83+
});
84+
} else {
85+
// console.log('undefined');
86+
setTimeout(f, 10)
87+
}
88+
} catch (e) { console.log(e); }
89+
}
90+
videoElement.addEventListener('canplay', function (e) { setTimeout(f, 0); });
91+
flvPlayer.on("error", function () {
7592
window.location.reload();
7693
});
7794
} catch (e) {
7895
console.log(e);
7996
}
80-
});
97+
});
8198
</script>
8299
</body>
83100
</html>

0 commit comments

Comments
 (0)