{"id":20484203,"url":"https://github.com/niklus/you-tube","last_synced_at":"2026-05-01T23:39:26.054Z","repository":{"id":57404178,"uuid":"105709272","full_name":"Niklus/you-tube","owner":"Niklus","description":"A web component built on top of the YouTube Iframe API","archived":false,"fork":false,"pushed_at":"2021-04-11T17:54:08.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-16T06:47:55.774Z","etag":null,"topics":["custom-elements","stencil","stenciljs","web-components","youtube","youtube-custom-element","youtube-iframe-api","youtube-web-component"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Niklus.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":"2017-10-03T22:16:32.000Z","updated_at":"2024-12-24T06:31:18.000Z","dependencies_parsed_at":"2022-09-12T00:31:22.715Z","dependency_job_id":null,"html_url":"https://github.com/Niklus/you-tube","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/Niklus%2Fyou-tube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Niklus%2Fyou-tube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Niklus%2Fyou-tube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Niklus%2Fyou-tube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Niklus","download_url":"https://codeload.github.com/Niklus/you-tube/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242058218,"owners_count":20065066,"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":["custom-elements","stencil","stenciljs","web-components","youtube","youtube-custom-element","youtube-iframe-api","youtube-web-component"],"created_at":"2024-11-15T16:20:26.813Z","updated_at":"2025-10-30T23:12:31.846Z","avatar_url":"https://github.com/Niklus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Built With Stencil](https://img.shields.io/badge/-Built%20With%20Stencil-16161d.svg?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI%2BCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI%2BCgkuc3Qwe2ZpbGw6I0ZGRkZGRjt9Cjwvc3R5bGU%2BCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MjQuNywzNzMuOWMwLDM3LjYtNTUuMSw2OC42LTkyLjcsNjguNkgxODAuNGMtMzcuOSwwLTkyLjctMzAuNy05Mi43LTY4LjZ2LTMuNmgzMzYuOVYzNzMuOXoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTQyNC43LDI5Mi4xSDE4MC40Yy0zNy42LDAtOTIuNy0zMS05Mi43LTY4LjZ2LTMuNkgzMzJjMzcuNiwwLDkyLjcsMzEsOTIuNyw2OC42VjI5Mi4xeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNDI0LjcsMTQxLjdIODcuN3YtMy42YzAtMzcuNiw1NC44LTY4LjYsOTIuNy02OC42SDMzMmMzNy45LDAsOTIuNywzMC43LDkyLjcsNjguNlYxNDEuN3oiLz4KPC9zdmc%2BCg%3D%3D\u0026colorA=16161d\u0026style=flat-square)\n\n# you-tube web component\n\nyou-tube is a web component built on top of the [YouTube Iframe API](https://developers.google.com/youtube/iframe_api_reference)\n\n## API\n\n### Properties\n - width (string) \n - height (string) \n - video_id (string) \n - autoplay (string) : \"1\" to auto play \u0026 \"0\" to not\n - controls (string) : \"1\" to show \u0026 \"0\" to hide\n\n### Event handler Properties\n - playerReady (Function) \n - playerStateChange (Function) \n - playbackQualityChange (Function)\n - playbackRateChange: (Function) \n - playerApiChange (Function)\n - playerError: (Function)\n \n## Using this component\n\n### Usage example\n\n#### In your html or jsx\n```html\n  \u003cyou-tube  \n    height='390' \n    width='640'\n    video_id='YBwgkr_Sbx0'\n    controls=\"0\"\n    autoplay=\"1\"\u003e\u003c/you-tube\u003e\n```\n\n#### Add the following script tag in the head of your .html page\n```html\n  \u003cscript \n    type=\"module\" \n    src=\"https://unpkg.com/you-tube@0.1.6/dist/you-tube/you-tube.esm.js\"\u003e\n  \u003c/script\u003e\n```\n\n### The player\n- The player object can be accessed through evt.target on the event handlers \n- [A List  of operations avilable on the player object can be found here](https://developers.google.com/youtube/iframe_api_reference#Operations)\n\n### Script tag\n- Put a script tag similar to this `\u003cscript type=\"module\" src=\"https://unpkg.com/you-tube@0.1.6/dist/you-tube/you-tube.esm.js\"\u003e\u003c/script\u003e` in the head of your .html page as shown above\n- Then you can use the element anywhere in your template, JSX, html etc\n- Remember to add type=\"module\" on your script tag as shown above\n\n### Node Modules\n- Run npm install you-tube --save\n- Put a script tag similar to this `\u003cscript type=\"module\" src=\"node_modules/you-tube/dist/you-tube/you-tube.esm.js\"\u003e\u003c/script\u003e` in the head of your .html page\n- Then you can use the element anywhere in your template, JSX, html etc\n- Remember to add type=\"module\" on your script tag as shown above\n\n### Demo\n- Look at the [DEMO](https://github.com/Niklus/you-tube-demo) and learn more on how to use the component\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklus%2Fyou-tube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklus%2Fyou-tube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklus%2Fyou-tube/lists"}