{"id":15824457,"url":"https://github.com/luwes/super-media-element","last_synced_at":"2025-09-04T22:32:24.792Z","repository":{"id":54822962,"uuid":"500845141","full_name":"luwes/super-media-element","owner":"luwes","description":"A custom element that helps save alienated player API's to bring back their true inner HTMLMediaElement API, or to extend a native media element like `\u003caudio\u003e` or `\u003cvideo\u003e`.","archived":false,"fork":false,"pushed_at":"2023-06-09T00:47:47.000Z","size":277,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-06T08:42:07.429Z","etag":null,"topics":["audio","custom-elements","htmlmediaelement","video","web-components"],"latest_commit_sha":null,"homepage":"","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/luwes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-07T13:09:35.000Z","updated_at":"2023-08-23T07:40:03.000Z","dependencies_parsed_at":"2024-10-26T13:34:05.849Z","dependency_job_id":"9eeeea29-ea25-4862-9e73-0742f1ce2bf1","html_url":"https://github.com/luwes/super-media-element","commit_stats":{"total_commits":88,"total_committers":3,"mean_commits":"29.333333333333332","dds":0.5681818181818181,"last_synced_commit":"a0ef4b737b8e743e1a51106902a6560ed70416eb"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/luwes/super-media-element","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luwes%2Fsuper-media-element","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luwes%2Fsuper-media-element/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luwes%2Fsuper-media-element/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luwes%2Fsuper-media-element/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luwes","download_url":"https://codeload.github.com/luwes/super-media-element/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luwes%2Fsuper-media-element/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273684696,"owners_count":25149717,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["audio","custom-elements","htmlmediaelement","video","web-components"],"created_at":"2024-10-05T08:42:14.273Z","updated_at":"2025-09-04T22:32:19.739Z","avatar_url":"https://github.com/luwes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Super Media Element\n\n[![Version](https://img.shields.io/npm/v/super-media-element?style=flat-square)](https://www.npmjs.com/package/super-media-element) \n[![Badge size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/super-media-element/+esm?compression=gzip\u0026label=gzip\u0026style=flat-square)](https://cdn.jsdelivr.net/npm/super-media-element/+esm)\n\nA custom element that helps save alienated player API's in bringing back their true inner \n[HTMLMediaElement API](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement), \nor to extend a native media element like `\u003caudio\u003e` or `\u003cvideo\u003e`.\n\n## Usage\n\n```js\nimport { SuperVideoElement } from 'super-media-element';\n\nclass MyVideoElement extends SuperVideoElement {\n\n  static observedAttributes = ['color', ...SuperVideoElement.observedAttributes];\n\n  // Skip from forwarding the `src` attribute to the native element.\n  static skipAttributes = ['src'];\n\n\n  async attributeChangedCallback(attrName, oldValue, newValue) {\n    \n    if (attrName === 'color') {\n      this.api.color = newValue;\n    }\n\n    super.attributeChangedCallback(attrName, oldValue, newValue);\n  }\n\n  async load() {\n    // This is called when the `src` changes.\n    \n    // Load a video player from a script here.\n    // Example: https://github.com/luwes/jwplayer-video-element/blob/main/jwplayer-video-element.js#L55-L75\n\n    this.api = new VideoPlayer();\n  }\n\n  get nativeEl() {\n    return this.querySelector('.loaded-video-element');\n  }\n}\n\nif (!globalThis.customElements.get('my-video')) {\n  globalThis.customElements.define('my-video', MyVideoElement);\n}\n\nexport { MyVideoElement };\n```\n\n\n## Related\n\n- [Media Chrome](https://github.com/muxinc/media-chrome) Your media player's dancing suit. 🕺\n- [`\u003cyoutube-video\u003e`](https://github.com/muxinc/youtube-video-element) A custom element for the YouTube player.\n- [`\u003cvimeo-video\u003e`](https://github.com/luwes/vimeo-video-element) A custom element for the Vimeo player.\n- [`\u003cjwplayer-video\u003e`](https://github.com/luwes/jwplayer-video-element) A custom element for the JW player.\n- [`\u003cwistia-video\u003e`](https://github.com/luwes/wistia-video-element) A custom element for the Wistia player.\n- [`\u003ccloudflare-video\u003e`](https://github.com/luwes/cloudflare-video-element) A custom element for the Cloudflare player.\n- [`\u003cvideojs-video\u003e`](https://github.com/luwes/videojs-video-element) A custom element for Video.js.\n- [`\u003chls-video\u003e`](https://github.com/muxinc/hls-video-element) A custom element for playing HTTP Live Streaming (HLS) videos.\n- [`castable-video`](https://github.com/muxinc/castable-video) Cast your video element to the big screen with ease!\n- [`\u003cmux-player\u003e`](https://github.com/muxinc/elements/tree/main/packages/mux-player) The official Mux-flavored video player custom element.\n- [`\u003cmux-video\u003e`](https://github.com/muxinc/elements/tree/main/packages/mux-video) A Mux-flavored HTML5 video element w/ hls.js and Mux data builtin.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluwes%2Fsuper-media-element","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluwes%2Fsuper-media-element","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluwes%2Fsuper-media-element/lists"}