From b8ef10b909c77d68effc19930628e201b7649c9d Mon Sep 17 00:00:00 2001 From: Sami Spets <savasp@utu.fi> Date: Mon, 18 Nov 2019 10:20:45 +0200 Subject: [PATCH] Started to do the libde265 videoplayer --- web-service/server/src/public/js/bundle.js | 18 +++++++++++------- web-service/server/src/public/js/index.js | 3 +++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/web-service/server/src/public/js/bundle.js b/web-service/server/src/public/js/bundle.js index 6089b8680..94fe5b00e 100644 --- a/web-service/server/src/public/js/bundle.js +++ b/web-service/server/src/public/js/bundle.js @@ -4711,23 +4711,24 @@ const cardLogic = () => { configs = () => { const container = document.getElementById("container"); container.innerHTML = `<div class="ftlab-configurations"></div>`; - let configContainer = document.getElementsByClassName("ftlab-configurations")[0]; + // let configContainer = document.getElementsByClassName("ftlab-configurations")[0]; + renderConfigOptions(); } renderConfigOptions = () => { - const input = `<p>input1</p><br><input type="text">` + const input = `<p>input1</p><br>ftl://utu.fi#<input type="text">` const doc = document.getElementsByClassName('ftlab-configurations')[0]; - doc.innerHTML = input + doc.innerHTML = input; } + updateConfigs = async () => { const rawResp = await fetch('http://localhost:8080/stream/config', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' - }, - body: JSON.stringify({board_size: [0, 5], square_size: 1, frame_delay: 5, num_frames: 10, URI: "current_data.uri"}) + } }); const content = await rawResp.json(); console.log(content) @@ -4739,12 +4740,15 @@ updateConfigs = async () => { * current_data.configURI is a dropdown menu */ -current_data.configs = "ftl://utu.fi#reconstruction_snap10/merge/maxerror" +current_data.configs = "ftl://utu.fi#reconstruction_snap10/merge" + loadConfigs = async () => { const configURI = encodeURIComponent(current_data.configs); const uri = encodeURIComponent(current_data.uri) const rawResp = await fetch(`http://localhost:8080/stream/config?settings=${configURI}&uri=${uri}`) - const content = await rawResp.json(); + const response = await rawResp.json(); + const content = JSON.parse(response); + container.innerHTML += `<p>${response}</p>`; console.log(content) } },{"../../peer":22}],24:[function(require,module,exports){ diff --git a/web-service/server/src/public/js/index.js b/web-service/server/src/public/js/index.js index 1afbd599b..9ed5bfd73 100644 --- a/web-service/server/src/public/js/index.js +++ b/web-service/server/src/public/js/index.js @@ -57,6 +57,9 @@ videoPlayer = () => { } +videoDecoder = () => { + let decoder = new libde265.Decoder(); +} /** * Creates thumbnail (image) for all available streams and adds them to div class='container' -- GitLab