Commit eb6d3019 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

pass filename with URL

parent 098a4697
...@@ -7,6 +7,8 @@ LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt ...@@ -7,6 +7,8 @@ LICENSE: AGPL, see http://www.gnu.org/licenses/agpl.txt
Copyright (C) 2015 Elphel, Inc. Copyright (C) 2015 Elphel, Inc.
*/ */
var jp4name = "test.jp4"
var FLIPV = 0; var FLIPV = 0;
var FLIPH = 0; var FLIPH = 0;
...@@ -23,12 +25,23 @@ var BayerMosaic = [ ...@@ -23,12 +25,23 @@ var BayerMosaic = [
]; ];
$(function(){ $(function(){
parseURL();
initCanvas(); initCanvas();
}); });
function parseURL() {
var parameters=location.href.replace(/\?/ig,"&").split("&");
for (var i=0;i<parameters.length;i++) parameters[i]=parameters[i].split("=");
for (var i=1;i<parameters.length;i++) {
switch (parameters[i][0]) {
case "file": jp4name = parameters[i][1];break;
}
}
}
function initCanvas(){ function initCanvas(){
var heavyImage = new Image(); var heavyImage = new Image();
heavyImage.src = "test.jp4"; heavyImage.src = jp4name;
var canvas = $("<canvas>",{id:"canvas"}).css({ var canvas = $("<canvas>",{id:"canvas"}).css({
position: "absolute", position: "absolute",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment