{"id":15046822,"url":"https://github.com/polymerelements/app-media","last_synced_at":"2025-06-17T23:37:11.704Z","repository":{"id":48032995,"uuid":"78378379","full_name":"PolymerElements/app-media","owner":"PolymerElements","description":"Elements for accessing data from media input devices and visualizing that data for users","archived":false,"fork":false,"pushed_at":"2023-10-16T14:02:54.000Z","size":342,"stargazers_count":61,"open_issues_count":20,"forks_count":12,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-27T07:50:44.830Z","etag":null,"topics":["audio","camera","media-capture","microphone","stream","video","visualization","web-audio"],"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/PolymerElements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-08T23:52:01.000Z","updated_at":"2024-05-29T14:21:09.000Z","dependencies_parsed_at":"2024-06-20T00:09:44.821Z","dependency_job_id":"de57c23c-6b5a-47fb-92c5-2334eb374f6a","html_url":"https://github.com/PolymerElements/app-media","commit_stats":{"total_commits":173,"total_committers":13,"mean_commits":"13.307692307692308","dds":0.6011560693641618,"last_synced_commit":"b4adee99d9dbfe697844a1ca35213dfbe394e530"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/PolymerElements/app-media","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fapp-media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fapp-media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fapp-media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fapp-media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/app-media/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Fapp-media/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260458715,"owners_count":23012499,"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":["audio","camera","media-capture","microphone","stream","video","visualization","web-audio"],"created_at":"2024-09-24T20:53:37.420Z","updated_at":"2025-06-17T23:37:06.689Z","avatar_url":"https://github.com/PolymerElements.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/app-media.svg)](https://www.npmjs.com/package/@polymer/app-media)\n[![Build status](https://travis-ci.org/PolymerElements/app-media.svg?branch=master)](https://travis-ci.org/PolymerElements/app-media)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/app-media)\n\n## App Media Elements\n\nElements for accessing data from media input devices, such as cameras and\nmicrophones, and visualizing that data for users.\n\n_See [the full explainer](./explainer.md) for detailed usage._\n\nSee: [Documentation](https://www.webcomponents.org/element/@polymer/app-media),\n  [Demo](https://www.webcomponents.org/element/@polymer/app-media/demo/demo/index.html).\n\n### Browser support\n\nThe following emerging platform APIs are used by this collection of elements:\n\n - [Media Capture and Streams](https://www.w3.org/TR/mediacapture-streams/)\n - [MediaStream Recording](https://www.w3.org/TR/mediastream-recording/)\n - [Web Audio API](https://www.w3.org/TR/webaudio/)\n - [MediaStream Image Capture](https://w3c.github.io/mediacapture-image/)\n\nSome additional browser support is enabled by\n[WebRTC polyfill](https://github.com/webrtc/adapter) and\n[MediaStream ImageCapture API polyfill](https://github.com/GoogleChromeLabs/imagecapture-polyfill).\nThe following table documents browser support for the elements in this collection with\nthese polyfills in use\n\n - ✅ Stable native implementation\n - 🚧 Partial fidelity with polyfill\n - 🚫 Not supported at all\n\nElement                   | Chrome | Safari 11 | Firefox | Edge  | IE 11\n--------------------------|--------|-----------|---------|-------|------\n`app-media-video`         |     ✅ |        ✅ |      ✅ |    ✅ |    ✅\n`app-media-audio`         |     ✅ |        ✅ |      ✅ |    ✅ |    🚫\n`app-media-waveform`      |     ✅ |        ✅ |      ✅ |    ✅ |    🚫\n`app-media-devices`       |     ✅ |        ✅ |      ✅ |    ✅ |    🚫\n`app-media-stream`        |     ✅ |        ✅ |      ✅ |    ✅ |    🚫\n`app-media-recorder`      |     ✅ |        🚫 |      ✅ |    🚫 |    🚫\n`app-media-image-capture` |     ✅ |        🚧 |      🚧 |    🚧 |    🚫\n\n## Usage\n\n### Installation\n\nElement:\n```\nnpm install --save @polymer/app-media\n```\n\nPolyfills:\n```\nnpm install --save webrtc-adapter\nnpm install --save image-capture\n```\n\n### In an HTML file\n\n##### `\u003capp-media-devices\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/app-media/app-media-devices.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003capp-media-devices\n        kind=\"audioinput\"\n        devices=\"{{microphones}}\"\u003e\n    \u003c/app-media-devices\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n##### `\u003capp-media-stream\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/app-media/app-media-devices.js';\n      import '@polymer/app-media/app-media-stream.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003capp-media-devices\n            kind=\"audioinput\"\n            devices=\"{{microphone}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-stream\n            audio-device=\"[[microphone]]\"\n            stream=\"{{microphoneStream}}\"\u003e\n        \u003c/app-media-stream\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### `\u003capp-media-video\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/app-media/app-media-devices.js';\n      import '@polymer/app-media/app-media-stream.js';\n      import '@polymer/app-media/app-media-video.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003capp-media-devices\n            kind=\"videoinput\"\n            devices=\"{{camera}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-stream\n            video-device=\"[[camera]]\"\n            stream=\"{{cameraStream}}\"\u003e\n        \u003c/app-media-stream\u003e\n        \u003capp-media-video\n            source=\"[[cameraStream]]\"\n            autoplay\u003e\n        \u003c/app-media-video\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### `\u003capp-media-recorder\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/app-media/app-media-devices.js';\n      import '@polymer/app-media/app-media-stream.js';\n      import '@polymer/app-media/app-media-recorder.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003capp-media-devices\n            kind=\"videoinput\"\n            devices=\"{{camera}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-devices\n            kind=\"audioinput\"\n            devices=\"{{microphone}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-stream\n            video-device=\"[[camera]]\"\n            audio-device=\"[[microphone]]\"\n            stream=\"{{cameraAndMicrophoneStream}}\"\u003e\n        \u003c/app-media-stream\u003e\n        \u003capp-media-recorder\n            id=\"recorder\"\n            stream=\"[[cameraAndMicrophoneStream]]\"\n            data=\"{{recordedVideo}}\"\n            duration=\"3000\"\u003e\n        \u003c/app-media-recorder\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n    \u003cscript\u003e\n      function createRecording() {\n        recorder.start();\n      }\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n##### `\u003capp-media-image-capture\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/app-media/app-media-devices.js';\n      import '@polymer/app-media/app-media-stream.js';\n      import '@polymer/app-media/app-media-image-capture.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003capp-media-devices\n            kind=\"videoinput\"\n            devices=\"{{camera}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-stream\n            video-device=\"[[camera]]\"\n            stream=\"{{videoStream}}\"\u003e\n        \u003c/app-media-stream\u003e\n        \u003capp-media-image-capture\n            id=\"imageCapture\"\n            stream=\"[[videoStream]]\"\n            focus-mode=\"single-shot\"\n            red-eye-reduction\n            last-photo=\"{{photo}}\"\u003e\n        \u003c/app-media-image-capture\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n    \u003cscript\u003e\n      function takePhoto() {\n        imageCapture.takePhoto();\n      }\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### `\u003capp-media-audio\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/app-media/app-media-devices.js';\n      import '@polymer/app-media/app-media-stream.js';\n      import '@polymer/app-media/app-media-audio.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003capp-media-devices\n            kind=\"videoinput\"\n            devices=\"{{camera}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-stream\n            video-device=\"[[camera]]\"\n            stream=\"{{videoStream}}\"\u003e\n        \u003c/app-media-stream\u003e\n        \u003capp-media-audio\n            stream=\"[[microphoneStream]]\"\n            analyser=\"{{microphoneAnalyzer}}\"\u003e\n        \u003c/app-media-audio\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### `\u003capp-media-waveform\u003e`\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/app-media/app-media-devices.js';\n      import '@polymer/app-media/app-media-stream.js';\n      import '@polymer/app-media/app-media-audio.js';\n      import '@polymer/app-media/app-media-waveform.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003capp-media-devices\n            kind=\"videoinput\"\n            devices=\"{{camera}}\"\u003e\n        \u003c/app-media-devices\u003e\n        \u003capp-media-stream\n            video-device=\"[[camera]]\"\n            stream=\"{{videoStream}}\"\u003e\n        \u003c/app-media-stream\u003e\n        \u003capp-media-audio\n            stream=\"[[microphoneStream]]\"\n            analyser=\"{{microphoneAnalyzer}}\"\u003e\n        \u003c/app-media-audio\u003e\n        \u003capp-media-waveform analyser=\"[[microphoneAnalyzer]]\"\u003e\n        \u003c/app-media-waveform\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### In a Polymer 3 element\n\n##### `\u003capp-media-devices\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"audioinput\"\n          devices=\"{{microphones}}\"\u003e\n      \u003c/app-media-devices\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n##### `\u003capp-media-stream\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\nimport '@polymer/app-media/app-media-stream.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"audioinput\"\n          devices=\"{{microphone}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-stream\n          audio-device=\"[[microphone]]\"\n          stream=\"{{microphoneStream}}\"\u003e\n      \u003c/app-media-stream\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n#### `\u003capp-media-video\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\nimport '@polymer/app-media/app-media-stream.js';\nimport '@polymer/app-media/app-media-video.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"videoinput\"\n          devices=\"{{camera}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-stream\n          video-device=\"[[camera]]\"\n          stream=\"{{cameraStream}}\"\u003e\n      \u003c/app-media-stream\u003e\n      \u003capp-media-video\n          source=\"[[cameraStream]]\"\n          autoplay\u003e\n      \u003c/app-media-video\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n#### `\u003capp-media-recorder\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\nimport '@polymer/app-media/app-media-stream.js';\nimport '@polymer/app-media/app-media-recorder.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"videoinput\"\n          devices=\"{{camera}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-devices\n          kind=\"audioinput\"\n          devices=\"{{microphone}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-stream\n          video-device=\"[[camera]]\"\n          audio-device=\"[[microphone]]\"\n          stream=\"{{cameraAndMicrophoneStream}}\"\u003e\n      \u003c/app-media-stream\u003e\n      \u003capp-media-recorder\n          id=\"recorder\"\n          stream=\"[[cameraAndMicrophoneStream]]\"\n          data=\"{{recordedVideo}}\"\n          duration=\"3000\"\u003e\n      \u003c/app-media-recorder\u003e\n    `;\n  }\n\n  createRecording() {\n    this.$.recorder.start();\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n##### `\u003capp-media-image-capture\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\nimport '@polymer/app-media/app-media-stream.js';\nimport '@polymer/app-media/app-media-image-capture.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"videoinput\"\n          devices=\"{{camera}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-stream\n          video-device=\"[[camera]]\"\n          stream=\"{{videoStream}}\"\u003e\n      \u003c/app-media-stream\u003e\n      \u003capp-media-image-capture\n          id=\"imageCapture\"\n          stream=\"[[videoStream]]\"\n          focus-mode=\"single-shot\"\n          red-eye-reduction\n          last-photo=\"{{photo}}\"\u003e\n      \u003c/app-media-image-capture\u003e\n    `;\n  }\n\n  takePhoto() {\n    this.$.imageCapture.takePhoto();\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n#### `\u003capp-media-audio\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\nimport '@polymer/app-media/app-media-stream.js';\nimport '@polymer/app-media/app-media-audio.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"videoinput\"\n          devices=\"{{camera}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-stream\n          video-device=\"[[camera]]\"\n          stream=\"{{videoStream}}\"\u003e\n      \u003c/app-media-stream\u003e\n      \u003capp-media-audio\n          stream=\"[[microphoneStream]]\"\n          analyser=\"{{microphoneAnalyzer}}\"\u003e\n      \u003c/app-media-audio\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n#### `\u003capp-media-waveform\u003e`\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/app-media/app-media-devices.js';\nimport '@polymer/app-media/app-media-stream.js';\nimport '@polymer/app-media/app-media-audio.js';\nimport '@polymer/app-media/app-media-waveform.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003capp-media-devices\n          kind=\"videoinput\"\n          devices=\"{{camera}}\"\u003e\n      \u003c/app-media-devices\u003e\n      \u003capp-media-stream\n          video-device=\"[[camera]]\"\n          stream=\"{{videoStream}}\"\u003e\n      \u003c/app-media-stream\u003e\n      \u003capp-media-audio\n          stream=\"[[microphoneStream]]\"\n          analyser=\"{{microphoneAnalyzer}}\"\u003e\n      \u003c/app-media-audio\u003e\n      \u003capp-media-waveform analyser=\"[[microphoneAnalyzer]]\"\u003e\n      \u003c/app-media-waveform\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n## Contributing\nIf you want to send a PR to this element, here are\nthe instructions for running the tests and demo locally:\n\n### Installation\n```sh\ngit clone https://github.com/PolymerElements/app-media\ncd app-media\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n```sh\npolymer test --npm\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Fapp-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Fapp-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Fapp-media/lists"}