小编ale*_*no2的帖子

包括ffmpeg与Chrome?

我正在尝试对VideoStream做类似的事情

它们包括带有nacl的 ffmpeg 并将其包含在chrome应用程序中

我正在努力,但我不能让naclportlist ffmpeg在我的项目上工作!

原因是那些

  • nacl不能与main()和命令行一起使用,而ffmpeg需要它
  • glibc,编译它的唯一方法,期望一个main()!不可能删除它(可能与ppapi?)

所以我的问题很简单,如何与ffmpeg和chrome沟通?如果VideoStream可以做到,为什么我不能?

非常感谢你的回答!

google-chrome ffmpeg google-nativeclient

5
推荐指数
0
解决办法
1527
查看次数

在JS中使用这个或新的?

我有3个代码:

var control = new Control();

function Control() {

   this.doSomethingElse = function() {...}
   this.doSomething = function () {
       control.doSomethingElse();
   }

}
Run Code Online (Sandbox Code Playgroud)

要么

var control = new Control();

function Control() {
   var self = this;

   this.doSomethingElse = function() {...}
   this.doSomething = function () {
       self.doSomethingElse();
   }
}
Run Code Online (Sandbox Code Playgroud)

要么

var control = Control();

function Control() {
   var self = this;

   this.doSomethingElse = function() {...}
   this.doSomething = function () {
       self.doSomethingElse();
   }

  return self;
}
Run Code Online (Sandbox Code Playgroud)

重要提示:该函数是一个控制器,只声明一次.然后我在我的代码中到处使用"控制"...

我想知道control.doSomethingElse()是否很慢?

最后,在这些例子中做什么和/或最快的代码是什么?

谢谢 !

javascript this declare

5
推荐指数
1
解决办法
92
查看次数

json html的安全方式?

我的问题很简单,我想用json重新创建一个html页面,但我不想搞乱现有的html,框架和co ...

示例:

var myDiv = { tag : "div", style : "color:blue", class : "jj", content : "Hello"};
Run Code Online (Sandbox Code Playgroud)

var myDiv = { tag : "div", style : "color:blue", class : "jj", content : "Hello"};
var param = { forbid : { tag : true, content : true } };
var createTag = function(o) {

    var node = document.createElement(o.tag);
    for (att in o) {
      if (!param.forbid[att]) node.setAttribute(att, o[att]);
    }
    node.appendChild(document.createTextNode(o.content))
    return node;

}


document.body.textContent = createTag(myDiv).outerHTML;
Run Code Online (Sandbox Code Playgroud)

这段代码的结果是:

<div style="color:blue" class="jj"> …
Run Code Online (Sandbox Code Playgroud)

html javascript json

3
推荐指数
1
解决办法
78
查看次数