Giter Club home page Giter Club logo

Comments (8)

ericwlange avatar ericwlange commented on May 12, 2024

Yeah, webtorrent_cli.js is a bit of a hack. LiquidServer is not mature enough yet to deal with really complex JavaScript.

To make the file, do the following:

% mkidr temp
% cd temp
% npm install webtorrent-cli
% cp $NODE_MODULES/webtorrent-cli/bin/cmd.js .

Then, edit cmd.js and add the two LiquidCore lines:

...

LiquidCore.emit('torrent_done', { files: torrent.files });

torrentDone() // <-- Add the above line before this one

and

...

LiquidCore.emit('draw', { progress: torrent.progress });

peerslisted += 1 // <-- Add the above line before this
return linesRemaining > 4

And finally, comment out the ascii-logo.txt chunk:

function runHelp () {
/* <-- add this
  fs.readFileSync(path.join(__dirname, 'ascii-logo.txt'), 'utf8')
    .split('\n')
    .forEach(function (line) {
      clivas.line('{bold:' + line.substring(0, 20) + '}{red:' + line.substring(20) + '}')
    })
*/ // <-- and this

Then,

% browserify -o webtorrent_cli.js --node --im --noparse=process --noparse=assert --noparse=buffer --noparse=child_process --noparse=constants --noparse=crypto --noparse=events --noparse=fs --noparse=os --noparse=path --noparse=process --noparse=readline --noparse=stream --noparse=url --noparse=util --noparse=vm cmd.js

It should work. You might have an issue with an exception looking for package.json. If that's the case, after the file is generated, comment out the line where it is requesting it.

from liquidcore.

punkwang avatar punkwang commented on May 12, 2024

i try to use "peerflix"
but can not to work

04-06 14:19:37.125 6930-6970/com.liquidtest E/libGameXtend: LUCID_1 (1491459577125) PowerXtend identified application start. Package name: com.liquidtest. Application is handled by GameXtend 04-06 14:19:38.423 6930-7028/com.liquidtest W/System.err: java.lang.reflect.InvocationTargetException 04-06 14:19:38.424 6930-7028/com.liquidtest W/System.err: at java.lang.reflect.Method.invoke(Native Method) 04-06 14:19:38.424 6930-7028/com.liquidtest W/System.err: at java.lang.reflect.Method.invoke(Method.java:372) 04-06 14:19:38.424 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.javascript.JSFunction.function(JSFunction.java:541) 04-06 14:19:38.424 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.javascript.JSFunction.functionCallback(JSFunction.java:511) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: Caused by: Error: access denied (EACCES) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.javascript.JSContext.evaluateScript(JSContext.java:264) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.javascript.JSContext.evaluateScript(JSContext.java:277) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.service.MicroService.onProcessStart(MicroService.java:517) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.node.Process.eventOnStart(Process.java:244) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.node.Process.access$800(Process.java:47) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.node.Process$3.__nodedroid_onLoad(Process.java:342) 04-06 14:19:38.425 6930-7028/com.liquidtest W/System.err: ... 4 more 04-06 14:19:38.426 6930-7028/com.liquidtest W/System.err: Error: java.lang.reflect.InvocationTargetException 04-06 14:19:38.427 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.javascript.JSFunction.function(JSFunction.java:551) 04-06 14:19:38.427 6930-7028/com.liquidtest W/System.err: at org.liquidplayer.javascript.JSFunction.functionCallback(JSFunction.java:511)

from liquidcore.

punkwang avatar punkwang commented on May 12, 2024

can you try to make "peerflix"

thanks

from liquidcore.

punkwang avatar punkwang commented on May 12, 2024

"webtorrent_cli" can not work !!!!

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Why don't you just use the webtorrent_cli.js that is included in the example project? It works.

from liquidcore.

punkwang avatar punkwang commented on May 12, 2024

the "webtorrent_cli.js" demo can not work in my android real device

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Can you try this one? I tested this just yesterday and it worked for me. If it fails, please send me the dalvik log.

from liquidcore.

ericwlange avatar ericwlange commented on May 12, 2024

Closing. Please reopen if this doesn't work.

from liquidcore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.