Javascript变量问题web2py

时间:2014-11-13 16:58:09

标签: web2py bower recorder.js

我正在尝试在web2py中使用一些javascript但是在第二个js文件中调用函数时遇到一个小问题。

我正在使用此处的代码https://github.com/mattdiamond/Recorderjs

如果我打开工作表,可以使用记录和停止按钮加载。如果按下它们,它们将记录在日志中,但忽略应在recorderWorker.js中调用的任何函数。所以我无法保存文件或看到它。

据我所知,它永远不会调用第二个javascript文件。如果我在alertWorker.js中放置警报框没有任何反应,但它们在Recorder.js中工作。

app.js文件

 // create a stream source to pass to Recorder.js
      var mediaStreamSource = context.createMediaStreamSource(localMediaStream);

     // create new instance of Recorder.js using the mediaStreamSource
     rec = new Recorder(mediaStreamSource, {
  // pass the path to recorderWorker.js file here
   workerPath: "static/recorderWorker.js"
 });

// start recording
rec.record();
 }, function(err){
    console.log('Browser not supported');
   });
}

recorder.js文件

(function(window){
var WORKER_PATH = 'static/recorderWorker.js';
 var Recorder = function(source, cfg)

1 个答案:

答案 0 :(得分:0)

var WORKER_PATH = 'static/recorderWorker.js'

以上是相对网址。如果"静态"指的是您应用的静态文件夹,请尝试:

var WORKER_PATH = '/myapp/static/recorderWorker.js'

您还需要更改该网址的其他实例。