{"id":13841690,"url":"https://github.com/mikeal/webtorrent-element","last_synced_at":"2025-04-06T07:15:23.135Z","repository":{"id":66003031,"uuid":"104685148","full_name":"mikeal/webtorrent-element","owner":"mikeal","description":"WebTorrent HTML element.","archived":false,"fork":false,"pushed_at":"2019-11-02T05:56:48.000Z","size":82,"stargazers_count":535,"open_issues_count":13,"forks_count":24,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-18T09:13:40.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-25T00:05:11.000Z","updated_at":"2024-10-08T02:57:17.000Z","dependencies_parsed_at":"2024-01-23T13:05:58.897Z","dependency_job_id":null,"html_url":"https://github.com/mikeal/webtorrent-element","commit_stats":null,"previous_names":["mikeal/webtorrent-component"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fwebtorrent-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fwebtorrent-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fwebtorrent-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeal%2Fwebtorrent-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeal","download_url":"https://codeload.github.com/mikeal/webtorrent-element/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445682,"owners_count":20939961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T17:01:18.470Z","updated_at":"2025-04-06T07:15:23.080Z","avatar_url":"https://github.com/mikeal.png","language":"JavaScript","funding_links":["https://www.patreon.com/bePatron?u=880479"],"categories":["JavaScript (485)","JavaScript"],"sub_categories":[],"readme":"# WebTorrent Element\n\nAn HTML element you can use to display content on WebTorrent.\n\n\u003cp\u003e\n  \u003ca href=\"https://www.patreon.com/bePatron?u=880479\"\u003e\n    \u003cimg src=\"https://c5.patreon.com/external/logo/become_a_patron_button.png\" height=\"40px\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nUsage:\n\n```html\n\u003cbody\u003e\n  \u003cscript src=\"https://cdn.jsdelivr.net/npm/webtorrent-element@latest/dist/webtorrent-element.min.js\"\u003e\u003c/script\u003e\n  \u003cweb-torrent src=\"MAGNETURL\" /\u003e\n\u003c/body\u003e\n```\n\nOften a torrent contains many files but you only want to display one.\nYou can do this using the `file` attribute.\n\n ```html\n\u003cweb-torrent src=\"MAGNETURL\" file=\"video.mp4\"/\u003e\n ```\n\nHere's some example code you can stick your application to get started. It\nloads and plays a Creative Commons video.\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/webtorrent-element@latest/dist/webtorrent-element.min.js\"\u003e\u003c/script\u003e\n\u003cweb-torrent src=\"magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10\u0026dn=Sintel\u0026tr=wss%3A%2F%2Ftracker.btorrent.xyz\u0026tr=wss%3A%2F%2Ftracker.fastcast.nz\u0026tr=wss%3A%2F%2Ftracker.openwebtorrent.com\u0026ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F\u0026xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent\"\n  file=\"Sintel.mp4\"\n  /\u003e\n```\n\nSince this is just a regular HTML element, and all the content appended as\nthe torrent loads are regular elements, you can add style in your own app\nlike you would any other HTML.\n\n### Bundling\n\nIf you want to build the component into the JavaScript bundle of your app\nyou can do so easily, but you'll need to handle loading a WebComponents\npolyfill on your own.\n\n```javascript\nconst WebTorrentComponent = require('webtorrent-element')\n\nlet elem = new WebTorrentComponent()\nelem.src = MAGNETURL\nelem.file = 'Sintel.mp4'\ndocument.body.appendChild(elem)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeal%2Fwebtorrent-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeal%2Fwebtorrent-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeal%2Fwebtorrent-element/lists"}