{"id":15516605,"url":"https://github.com/git-ced/solid-plyr","last_synced_at":"2025-04-23T03:52:44.746Z","repository":{"id":46678108,"uuid":"410920008","full_name":"git-ced/solid-plyr","owner":"git-ced","description":"A simple HTML5, YouTube, and Vimeo player (Plyr) for SolidJS","archived":false,"fork":false,"pushed_at":"2021-10-07T23:52:26.000Z","size":1195,"stargazers_count":28,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T19:17:38.289Z","etag":null,"topics":["hacktoberfest","plyr","solid-js"],"latest_commit_sha":null,"homepage":"https://solid-plyr.netlify.app/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/git-ced.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-27T14:33:17.000Z","updated_at":"2024-12-11T08:18:32.000Z","dependencies_parsed_at":"2022-07-22T19:33:42.670Z","dependency_job_id":null,"html_url":"https://github.com/git-ced/solid-plyr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-ced%2Fsolid-plyr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-ced%2Fsolid-plyr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-ced%2Fsolid-plyr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-ced%2Fsolid-plyr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-ced","download_url":"https://codeload.github.com/git-ced/solid-plyr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366688,"owners_count":21418768,"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":["hacktoberfest","plyr","solid-js"],"created_at":"2024-10-02T10:08:49.495Z","updated_at":"2025-04-23T03:52:44.732Z","avatar_url":"https://github.com/git-ced.png","language":"CSS","readme":"# solid-plyr\n\u003e A simple HTML5, YouTube and Vimeo player (Plyr) for SolidJS\n\n[![NPM](https://img.shields.io/npm/v/solid-plyr.svg)](https://www.npmjs.com/package/solid-plyr)\n![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/solid-plyr)\n![npm bundle size (scoped version)](https://img.shields.io/bundlephobia/minzip/solid-plyr)\n![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/solid-plyr)\n![NPM](https://img.shields.io/npm/l/solid-plyr)\n\n## Table of Contents\n - [Installation](#installation)\n - [Setup](#setup)\n - [Usage](#usage)\n - [Authors](#authors)\n - [Changelog](#changelog)\n - [License](#license)\n\n \u003c!-- toc --\u003e\n\n## Installation\n\nThis library is available through the [npm registry](https://www.npmjs.com/).\n\nNPM\n```bash\n$ npm -i solid-plyr\n```\n\nYarn\n```bash\n$ yarn add solid-plyr\n```\n\n## Setup\n\nStart using it by importing the library first.\n\n### CommonJS\n```javascript\nconst SolidPlyr = require('solid-plyr');\n```\n\nor \n\n### ES6\n```javascript\nimport { SolidPlyr } from 'solid-plyr';\n```\n\nThe `SolidPlyr` component requires the following CSS for styling:\n\n**Using link tags**\n```html\n\u003clink href=\"https://unpkg.com/solid-plyr@1.0.0/dist/esm/index.css.map\" rel=\"stylesheet\"\u003e\n```\n\n**Using import**\n```javascript\nimport 'solid-plyr/dist/esm/index.css.map';\n```\n\n## Usage\n\n**Video playback using Solid Plyr Player**\n```javascript\nimport { SolidPlyr } from 'solid-plyr';\n\nconst SOURCE = {\n  type: 'video',\n  sources: [\n    {\n      src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-720p.mp4',\n      type: 'video/mp4',\n      size: 720,\n    },\n    {\n      src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-1080p.mp4',\n      type: 'video/mp4',\n      size: 1080,\n    }\n  ]\n}\n\nconst OPTIONS = {\n  autoplay: true,\n  muted: true,\n}\n\nexport default function Player() {\n  return (\n    \u003cSolidPlyr source={SOURCE} options={OPTIONS} /\u003e\n  );\n}\n```\n\n**Uncontrolled Solid Plyr Player**\n```javascript\nimport { UncontrolledSolidPlyr, createPlyr } from 'solid-plyr';\nimport { createEffect } from 'solid-js';\n\nconst SOURCE = {\n  // ...\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  const [ref, setRef] = createPlyr({ \n    source: SOURCE,\n    options: OPTIONS,\n  });\n\n  createEffect(() =\u003e {\n    const player = ref()?.plyr;\n\n    if (player) {\n      player.on('timeupdate', (event) =\u003e {\n        // Log current time while playing the playback\n        console.log(event.detail.plyr.currentTime);\n      });\n    }\n  })\n\n  return (\n    \u003cUncontrolledSolidPlyr ref={setRef} /\u003e\n  );\n}\n```\n\n**Play YouTube Videos using Solid Plyr**\n```javascript\nimport { SolidPlyr } from 'solid-plyr';\n\nconst SOURCE = {\n  type: 'video',\n  sources: [\n    {\n      src: 'yWtFb9LJs3o',\n      provider: 'youtube'\n    }\n  ]\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  return (\n    \u003cSolidPlyr source={SOURCE} options={OPTIONS} /\u003e\n  );\n}\n```\n\n**Play Vimeo Videos using Solid Plyr**\n```javascript\nimport { SolidPlyr } from 'solid-plyr';\n\nconst SOURCE = {\n  type: 'video',\n  sources: [\n    {\n      src: 'https://vimeo.com/533559247',\n      provider: 'vimeo'\n    }\n  ]\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  return (\n    \u003cSolidPlyr source={SOURCE} options={OPTIONS} /\u003e\n  );\n}\n```\n\n**Video Playback with HLS using Solid Plyr**\n```javascript\nimport { SolidHlsPlyr } from 'solid-plyr';\n\nconst SOURCE = {\n  type: 'video',\n  sources: [\n    {\n      src:\n        'https://bitmovin-a.akamaihd.net/content/playhouse-vr/m3u8s/105560.m3u8',\n      type: 'application/x-mpegURL'\n    }\n  ]\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  return (\n    \u003cSolidHlsPlyr source={SOURCE} options={OPTIONS} /\u003e\n  );\n}\n```\n\n**Uncontrolled Video Playback with HLS using Solid Plyr**\n```javascript\nimport { UncontrolledSolidPlyr, createHlsPlyr } from 'solid-plyr';\nimport { createEffect } from 'solid-js';\n\nconst SOURCE = {\n  // ...\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  const [ref, setRef] = createHlsPlyr({ \n    source: SOURCE,\n    options: OPTIONS,\n  });\n\n  createEffect(() =\u003e {\n    const player = ref()?.plyr;\n\n    if (player) {\n      player.on('timeupdate', (event) =\u003e {\n        // Log current time while playing the playback\n        console.log(event.detail.plyr.currentTime);\n      });\n    }\n  })\n\n  return (\n    \u003cUncontrolledSolidPlyr ref={setRef} /\u003e\n  );\n}\n```\n\n**Video Playback with Dash using Solid Plyr**\n```javascript\nimport { SolidDashPlyr } from 'solid-plyr';\n\nconst SOURCE = {\n  type: 'video',\n  sources: [\n    {\n      src: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',\n      type: 'application/dash+xml',\n    }\n  ]\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  return (\n    \u003cSolidDashPlyr source={SOURCE} options={OPTIONS} /\u003e\n  );\n}\n```\n\n**Uncontrolled Video Playback with Dash using Solid Plyr**\n```javascript\nimport { UncontrolledSolidPlyr, createDashPlyr } from 'solid-plyr';\nimport { createEffect } from 'solid-js';\n\nconst SOURCE = {\n  // ...\n}\n\nconst OPTIONS = {\n  // ...\n}\n\nexport default function Player() {\n  const [ref, setRef] = createDashPlyr({ \n    source: SOURCE,\n    options: OPTIONS,\n  });\n\n  createEffect(() =\u003e {\n    const player = ref()?.plyr;\n\n    if (player) {\n      player.on('timeupdate', (event) =\u003e {\n        // Log current time while playing the playback\n        console.log(event.detail.plyr.currentTime);\n      });\n    }\n  })\n\n  return (\n    \u003cUncontrolledSolidPlyr ref={setRef} /\u003e\n  );\n}\n```\n\n## Authors\n\n- [Prince Neil Cedrick Castro](https://github.com/git-ced/) - Initial work\n\nSee also the list of [contributors](https://github.com/git-ced/solid-plyr/contributors) who participated in this project.\n\n## Changelog\n\n[Changelog](https://github.com/git-ced/solid-plyr/releases)\n\n## License\n\n  [MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-ced%2Fsolid-plyr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-ced%2Fsolid-plyr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-ced%2Fsolid-plyr/lists"}