{"action":"created","issue":{"url":"https://api.github.com/repos/feross/webtorrent/issues/425","labels_url":"https://api.github.com/repos/feross/webtorrent/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/feross/webtorrent/issues/425/comments","events_url":"https://api.github.com/repos/feross/webtorrent/issues/425/events","html_url":"https://github.com/feross/webtorrent/pull/425","id":105849613,"number":425,"title":"[Feature proposition] Allow to render a torrent into an existing element","user":{"login":"valeriangalliat","id":3929133,"avatar_url":"https://avatars.githubusercontent.com/u/3929133?v=3","gravatar_id":"","url":"https://api.github.com/users/valeriangalliat","html_url":"https://github.com/valeriangalliat","followers_url":"https://api.github.com/users/valeriangalliat/followers","following_url":"https://api.github.com/users/valeriangalliat/following{/other_user}","gists_url":"https://api.github.com/users/valeriangalliat/gists{/gist_id}","starred_url":"https://api.github.com/users/valeriangalliat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/valeriangalliat/subscriptions","organizations_url":"https://api.github.com/users/valeriangalliat/orgs","repos_url":"https://api.github.com/users/valeriangalliat/repos","events_url":"https://api.github.com/users/valeriangalliat/events{/privacy}","received_events_url":"https://api.github.com/users/valeriangalliat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-10T16:41:49Z","updated_at":"2015-12-22T05:56:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/feross/webtorrent/pulls/425","html_url":"https://github.com/feross/webtorrent/pull/425","diff_url":"https://github.com/feross/webtorrent/pull/425.diff","patch_url":"https://github.com/feross/webtorrent/pull/425.patch"},"body":"Like `file.appendTo`, but taking an existing element as parameter, for example:\r\n\r\n```html\r\n<img src=\"magnet:?xt=urn:btih:d2346c943f770eba4994e25fa7b478692bcf0064&amp;dn=test.png\">\r\n```\r\n\r\n```js\r\nconst WebTorrent = require('webtorrent')\r\nconst client = new WebTorrent()\r\n\r\nArray.from(document.querySelectorAll('[src^=magnet:]')).forEach(elem =>\r\n  client.add(elem.src, torrent =>\r\n    torrent.files[0].renderTo(elem)\r\n  )\r\n)\r\n```\r\n\r\nSee the [`Implement 'render-to' method`](https://github.com/feross/webtorrent/commit/cfc59321c0866cd7a2b2c38666fe045b68e579c2) commit to have a proper diff, because `append-to.js` was renamed to `handle.js` and it's messing the full PR diff."},"comment":{"url":"https://api.github.com/repos/feross/webtorrent/issues/comments/166519343","html_url":"https://github.com/feross/webtorrent/pull/425#issuecomment-166519343","issue_url":"https://api.github.com/repos/feross/webtorrent/issues/425","id":166519343,"user":{"login":"RomanEmelyanov","id":6029110,"avatar_url":"https://avatars.githubusercontent.com/u/6029110?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanEmelyanov","html_url":"https://github.com/RomanEmelyanov","followers_url":"https://api.github.com/users/RomanEmelyanov/followers","following_url":"https://api.github.com/users/RomanEmelyanov/following{/other_user}","gists_url":"https://api.github.com/users/RomanEmelyanov/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanEmelyanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanEmelyanov/subscriptions","organizations_url":"https://api.github.com/users/RomanEmelyanov/orgs","repos_url":"https://api.github.com/users/RomanEmelyanov/repos","events_url":"https://api.github.com/users/RomanEmelyanov/events{/privacy}","received_events_url":"https://api.github.com/users/RomanEmelyanov/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T05:56:21Z","updated_at":"2015-12-22T05:56:21Z","body":"I'm work under https://github.com/feross/webtorrent/issues/531\r\n\r\nrender-to method does not include yet to main branch :(\r\n\r\nDo you have the patch as standalone javascript file to include as the second after:\r\nhttps://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js\r\n?"}}