Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embed API #118

Open
btzr-io opened this issue Apr 24, 2018 · 12 comments
Open

Embed API #118

btzr-io opened this issue Apr 24, 2018 · 12 comments

Comments

@btzr-io
Copy link
Contributor

btzr-io commented Apr 24, 2018

Embed api to integrate on other websites and apps.
@workhorsy See: lbryio/lbry-desktop#1377

@btzr-io
Copy link
Contributor Author

btzr-io commented Apr 24, 2018

Something like this?

api/reader?source=url...

We could also pass default settings:

api/reader?source=url..&nightmode=true

@workhorsy
Copy link
Owner

This is a good idea. Then people could use it to post a link to a comic, or embed the reader in another web app. Cool.

@btzr-io btzr-io mentioned this issue Apr 26, 2018
11 tasks
@btzr-io
Copy link
Contributor Author

btzr-io commented Apr 30, 2018

@workhorsy I did some work on this, Here is the current usage:

Main url ( show / navigate to reader )

http://localhost:8080/#/reader

Load comic ( url / blob to archive file)

If no file is provided it should show the files component:

  • A Button to upload comic files.
  • Alternative Drag / drop zone for uploading files.

http://localhost:8080/#/reader?file={url}

Page number ( set initial page: default to 1 )

http://localhost:8080/#/reader?pg=1

@workhorsy
Copy link
Owner

Does it work with loading files? I tried

http://localhost:8080/#/reader?file=http://localhost:9999/example.cbr

and it does not load. It still loads the test images.

Is it hooked up to loading files from cbz yet?

@btzr-io
Copy link
Contributor Author

btzr-io commented May 1, 2018

@workhorsy do a git pull and try this:

http://localhost:8080/#/reader?file=https://raw.githubusercontent.com/workhorsy/uncompress.js/master/example_rar_5.rar

I tried to use the uncompress download example but isn't working 😕

action: "error" , error: "Failed to open 'rar' archive."

@btzr-io
Copy link
Contributor Author

btzr-io commented May 1, 2018

Update: uncompress works in the main tread but not inside the web-worker

@workhorsy Any ideas?
Let me know if you have time to look into this.

Post message (start uncompress)

https://github.com/btzr-io/comic_book_reader/blob/preact/src/routes/viewer/view.jsx#L42

The Worker

https://github.com/btzr-io/comic_book_reader/blob/preact/src/routes/viewer/lib/uncompress.worker.js

@workhorsy
Copy link
Owner

I'll see if I can figure it out. I might be able to squeeze in some time in the morning.

@workhorsy
Copy link
Owner

Looks like zip is working:

http://localhost:8080/#/reader?file=http://localhost:8080/test/example.cbz

but not rar:

http://localhost:8080/#/reader?file=http://localhost:8080/test/example.cbr

@workhorsy
Copy link
Owner

I think I've got it figured out. The problem is that the worker calls loadArchiveFormats(['rar', 'zip', 'tar']) to start loading the compression formats. But the view starts sending it messages before loadArchiveFormats is done. You need the worker to send a signal to the view when it is done with loadArchiveFormats.

@workhorsy
Copy link
Owner

Here is a PR to fix this. I should probably update the uncompress.js worker example to do this too. It looks like a usability bug. Now this should work

http://localhost:8080/#/reader?file=http://localhost:8080/test/example.cbr

btzr-io#2

@btzr-io
Copy link
Contributor Author

btzr-io commented May 2, 2018

Great thanks!, I'll merge this ASAP.

@btzr-io
Copy link
Contributor Author

btzr-io commented May 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants