Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[Feature proposition] Allow to render a torrent into an existing element #425
Conversation
This comment has been minimized.
This comment has been minimized.
|
Any comment on this feature? |
This comment has been minimized.
This comment has been minimized.
madd512
commented
Nov 9, 2015
|
I like it. I've wanted this myself. |
This comment has been minimized.
This comment has been minimized.
RomanEmelyanov
commented
Dec 22, 2015
|
I'm work under #531 render-to method does not include yet to main branch :( Do you have the patch as standalone javascript file to include as the second after: |
This comment has been minimized.
This comment has been minimized.
|
@feross I rebased the PR, ready to merge in master! I'd like a review and approval of other WebTorrent contributors before merging, do you know who to ping? Thanks. :) |
| } | ||
|
|
||
| function fatalError (err) { | ||
| err.message = 'Error appending file "' + file.name + '" to DOM: ' + err.message |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
madd512
commented
Dec 22, 2015
|
It looks pretty good to me, but if you don't mind a little unsolicited feedback, I'd call |
This comment has been minimized.
This comment has been minimized.
|
@devtristan Thanks for your comments, I fixed the error message and renamed |
* Update 'handle' (previously 'append-to') to take a 'getElem' function instead of directly a root element, allowing to custimize the element injection method, and without directly manipulating the DOM. * Reimplement 'append-to' using abstract 'handle' method. * Implement a 'render-to' method to render a torrent inside an existing element.
| if (err) return fatalError(err) | ||
| elem.src = url | ||
| elem.alt = file.name | ||
| cb(null) |
This comment has been minimized.
This comment has been minimized.
| elem.play() | ||
| }) | ||
| elem.autoplay = true // for chrome | ||
| elem.play() // for firefox |
This comment has been minimized.
This comment has been minimized.
feross
Dec 28, 2015
Member
createMedia needs to append to the DOM too. Right now, only createElem does.
This comment has been minimized.
This comment has been minimized.
|
@valeriangalliat Thanks for the good PR! It has a few issues (mentioned as inline comments), but I can fix those up after merge. You rock! |
[Feature proposition] Allow to render a torrent into an existing element
This comment has been minimized.
This comment has been minimized.
|
Released as 0.65.0. |
This comment has been minimized.
This comment has been minimized.
|
Awesome, thanks for fixing the issues! |
This comment has been minimized.
This comment has been minimized.
|
No problem. Thanks for taking the initiative to fix the issue :) I really appreciate that. |
This comment has been minimized.
This comment has been minimized.
RomanEmelyanov
commented
Dec 29, 2015
|
Thanks a lot! Any plans to add "renderTo" method to "https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js" ? |
This comment has been minimized.
This comment has been minimized.
|
@RomanEmelyanov The new code should be available at that url. You might need to clear your cache to see it. |
This comment has been minimized.
This comment has been minimized.
RomanEmelyanov
commented
Jan 10, 2016
|
What I'm do wrong?
|
This comment has been minimized.
This comment has been minimized.
RomanEmelyanov
commented
Jan 10, 2016
|
SOLVED: I'm forget to add "controls" and "autoplay" for |
This comment has been minimized.
This comment has been minimized.
nextgenthemes
commented
Oct 2, 2016
•
|
So if I put controls and autoplay on a element and you Also what does it do when the torrent file is not a video and I set it to render to a video tag? |
This comment has been minimized.
This comment has been minimized.
The default is
It will try to put the file data into the video tag which will just make the video tag fire an |
This comment has been minimized.
This comment has been minimized.
nextgenthemes
commented
Oct 6, 2016
|
@feross Thanks. But I need to disable autoplay and I was thinking it would be convenient to use Between the lines you answered my question with "No". So the |
This comment has been minimized.
This comment has been minimized.
|
You can disable autoplay by passing an |
This comment has been minimized.
This comment has been minimized.
nextgenthemes
commented
Oct 8, 2016
|
I know and I do this now.
|
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
May 4, 2018
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
valeriangalliat commentedSep 10, 2015
Like
file.appendTo, but taking an existing element as parameter, for example:See the
Implement 'render-to' methodcommit to have a proper diff, becauseappend-to.jswas renamed torender.jsand it's messing the full PR diff.Related: #531.