summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-05-09 08:05:54 +0300
committerDevaev Maxim <[email protected]>2021-05-09 08:05:54 +0300
commit82c334215f7490f230a5629c330421680e57b3bc (patch)
tree42e82540a1af5351180ebf68ea63724c3710c37f /web
parent42601dae58c3a4fad9df153f3cf87a62b724b535 (diff)
refactoring
Diffstat (limited to 'web')
-rw-r--r--web/share/js/kvm/stream.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 19ffbedf..1a5d1c67 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -42,6 +42,16 @@ function _MjpegStreamer(set_active_callback, set_inactive_callback, set_info_cal
/************************************************************************/
+ self.getResolution = function() {
+ let el_image = $("stream-image");
+ return {
+ real_width: el_image.naturalWidth,
+ real_height: el_image.naturalHeight,
+ view_width: el_image.offsetWidth,
+ view_height: el_image.offsetHeight,
+ };
+ };
+
self.ensureStream = function(state) {
if (state) {
__state = state;
@@ -177,13 +187,7 @@ export function Streamer() {
/************************************************************************/
self.getResolution = function() {
- let el_image = $("stream-image");
- return {
- real_width: el_image.naturalWidth,
- real_height: el_image.naturalHeight,
- view_width: el_image.offsetWidth,
- view_height: el_image.offsetHeight,
- };
+ return __mjpeg.getResolution();
};
self.setJanusEnabled = function(enabled) {