Comments (8)
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.
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.
can you try to make "peerflix"
thanks
from liquidcore.
"webtorrent_cli" can not work !!!!
from liquidcore.
Why don't you just use the webtorrent_cli.js
that is included in the example project? It works.
from liquidcore.
the "webtorrent_cli.js" demo can not work in my android real device
from liquidcore.
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.
Closing. Please reopen if this doesn't work.
from liquidcore.
Related Issues (20)
- Use jsexport methods in microservice js file
- How to build liquidcore-xxx-x.x.x.aar files? HOT 2
- use of undeclared identifier 'ftello'; did you mean 'ftell'?
- ArrayIndexOutOfBoundsException calling into javascript function
- Integrate with Android Studio via implementation
- Is there some way to choose which version of Node is used? HOT 1
- PLEASE correct your github package information HOT 2
- Cannot import liquidcore in java code HOT 1
- Fix like this please! Pass null value from JS to native causes an exception
- Can't figure out how to install modules please help HOT 1
- java.util.Set com.google.gson.JsonObject.keySet()
- How to better debug JS code in flutter environment
- String length limitations?
- Serious memory leak (Android liquidcore) HOT 4
- Android - zsh: parse error near `\n
- xcode build failed (iOS) HOT 4
- How can I get the running log? HOT 2
- Xcode build failed at LiquidCore-headers
- Running Angular / NodeJS app as standalone on macOS, iOS and Android
- BUILD FAILED in 16s
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liquidcore.