Coder Social home page Coder Social logo

polymerelements / app-media Goto Github PK

View Code? Open in Web Editor NEW
61.0 61.0 12.0 342 KB

Elements for accessing data from media input devices and visualizing that data for users

HTML 31.17% JavaScript 68.83%
audio camera media-capture microphone stream video visualization web-audio

app-media's People

Contributors

aomarks avatar bicknellr avatar cdata avatar e111077 avatar fluorescenthallucinogen avatar j0000el avatar jaysunsyn avatar notwaldorf avatar rictic avatar samaratrilling avatar samuelli avatar tedium-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-media's Issues

Expose MediaRecorder bitrate options in app-media-recorder

Description

Expose videoBitsPerSecond, audioBitsPerSecond (and perhaps bitsPerSecond) in app-media-recorder, which are options passed into MediaRecorder constructor (https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder). This will enable higher quality video recording.

Expected outcome

Ability to customize bitrate options

Actual outcome

Bits per second encoding is always default (which can appear overly compressed at 720p, for instance)

app-media-stream fails to stop camera access when 'active' property set to false.

Description

app-media-stream fails to stop camera access when 'active' property set to false.

Expected outcome

When app-media-stream.active is set to false, all media tracks should be stopped and Chrome should no longer indicate that website is accessing camera.

Actual outcome

Chrome indicates that website is accessing camera (recording red dot in tab in desktop or notification on mobile) until tab is killed or page is refreshed.

Steps to reproduce

  1. Add app-media-stream to page with some video constraints and active = true.
  2. Browser indicates that website is accessing camera.
  3. Set active = false
  4. Browser still indicates that website is accessing camera.

Browsers Affected

Only tested on latest stable Chrome.

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Current version not available on npm

Description

The currently available version of this element set on npm is the 3.0.0-pre.19.

The current version on master, according to package.json, seems to be 2.0.0, and it includes a series of bugfixes. Without these bugfixes, app-media-image-capture doesn't work in the Polymer 3/npm based version of the element.

Could you please publish on npm a version with bugfix? And ideally also fixing the version schema, i.e. putting it in 3.0.0.

Thanks a lot, and once again congrats on the good job!!!!

Add <app-media-shape-detection> element

@cdata First of all, thank you so much for all your work! <app-media> elements are awesome! πŸ‘

FYI, I've added <app-media> elements into my progressive-elements collection that contains web components for modern features/APIs (i.e. building blocks for progressive web apps).

What about Shape Detection API web component (e.g. <app-media-shape-detection>)? πŸ˜‰

You can read more about Shape Detection API in @PaulKinlan's blog:

https://paul.kinlan.me/face-detection/
https://paul.kinlan.me/barcode-detection/
https://paul.kinlan.me/detecting-text-in-an-image/

TL;DR: Shape Detection API is a Web API for QR/barcode/text/face detection in live or still images. See use cases: https://github.com/WICG/shape-detection-api#use-cases-camera

In the near future, I plan to develop web components for Google Cloud Vision API, Google Cloud Speech API, Google Cloud Translate API.

It helps easily and quickly develop mind-blowing progressive web apps similar to @dmotz's Thing Translator using web components only. πŸ”₯

Also I'm thinking about web component for NTechLab FindFace API, but that's a different story… 😜

The polymer-cli demo isn't working

Description

Using the provided Polymer 3 as defined here https://github.com/PolymerElements/app-media#app-media-devices-1 , the element isn't rendered properly and isn't showing up on the screen. The same issue occurs when trying to load the demo from the contributing section with polymer-cli

Expected outcome

A Web UI element that we could select the device (microphone)

Actual outcome

Nothing is shown on the Web Page. Running Chrome Debugger, we can see the present in the DOM. Further debugging using breakpoint in the app-media-devices.js, we can see that the devices property is set with the available audioinput. However, the html element doesn't have the devices attribute define.

Live Demo

https://www.webcomponents.org/element/@polymer/app-media/demo/demo/index.html

Steps to reproduce

  1. Run the polymer-cli demo as suggested on the home page

Browsers Affected

  • [X ] Chrome
  • [X ] Firefox

Add <app-media-image-capture> demo

Please add a demo that demonstrates the capabilities of <app-media-image-capture> element: manual change the camera hardware settings (zoom, focus mode, contrast, ISO, white balance, etc.).

Version for modulized code?

I've run the modulizer over app-media and pushed the results up to the 3.0-preview branch. I'm wondering what version we should use when we publish it to npm. The pattern we've been going with so far has been (major version bump)-pre.1 but I'm unsure we you want the modulized version to be 1.0 or if there may be more API changes / stabilization before 1.0.

Thoughts? @cdata @FluorescentHallucinogen

app-media-image takePhoto() only works the first time called in Polymer 2

Description

Second attempt call app-media-image-capture.takePhoto() does nothing when running in Polymer v2.

I also see this error in the console:
Uncaught TypeError: Failed to construct 'ImageCapture': parameter 1 is not of type 'MediaStreamTrack'.
at HTMLElement.__computeImageCapture (app-media-image-capture.js:58)

Expected outcome

Each call to takePhoto() should take a new photo.

Actual outcome

Only the first takePhoto call works in Polymer 2.

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Add Presentation API element(s)

What about adding web component(s) for Presentation API (https://w3c.github.io/presentation-api/)?

In discussion with @kenchris he said that Presentation API element(s) should be part of app-media elements.

Seems, Presentation API is quite simple.
See https://developer.mozilla.org/docs/Web/API/Presentation_API.
Live demo: https://googlechrome.github.io/samples/presentation-api/index.html.
But I worry about good web component API (interface design). What properties and methods should Presentation API element (or elements) have?

app-media-image-capture error 'ImageCapture instance not ready'

Description

app-media-image capture raises 'ImageCapture instance not ready' error

Expected outcome

Should display the content that the camera is streaming

Actual outcome

No content is being displayed and error appears.

Steps to reproduce

  1. import all the app-media modules
  2. add the app-media-devices component
  3. add the app-media-stream component
  4. add the app-media-image-capture component

Browsers Affected

Tested on Chrome.

Code Sample

This is how my code looks like

<app-media-devices kind="videoinput" selected-device="{{videoDevice}}"> </app-media-devices> <app-media-stream video-device="[[videoDevice]]" audio-device="[[audioDevice]]" stream="{{stream}}" active> </app-media-stream>
<app-media-image-capture id="imageCapture" stream="[[videoDevice]]" focus-mode="single-shot" last-photo="{{photo}}"> </app-media-image-capture>

my script

takePhoto() { this.$.imageCapture.takePhoto(); }

Video control ?

Is it possible to control the videos ? likepause/unpause or slide video duration etc ?

<app-media-recorder /> is not recoding in audio/wav mime type.

Description

The app-media-recorder element is not recording in proper .wav file format.

Expected outcome

The element should generate a valid WAV format with LPCM audio for maximum audio quality.

Actual outcome

The element records in audio/webm, even if you specify mime-type="audio/wav".

Live Demo

MyRecording.zip

Steps to reproduce

  1. Put a app-media-recorder element in the page.
  2. Open the page in a web browser.
  3. Set the mime-type="audio/wav"
  4. Record using the app-media-recorder element.

Browsers Affected

  • Chrome

app-media-image-capture can't set the track constraints

Description

app-media-image-capture can't set the track constraints

Expected outcome

Should set the constraints when setting the constraint property.

Actual outcome

Nothing changed when I set constraint property.

Steps to reproduce

  1. Set the pointsOfInterest property, the focus point of camera does not change.

Browsers Affected

Tested on Chrome of Pixel

Add properties for min, max and step values for various camera settings to <app-media-image-capture>

What about adding properties for minimum, maximum and step values for each camera settings to <app-media-image-capture> element?

It makes data binding easy:

<app-media-image-capture
  stream="[[stream]]"
  zoom-min="{{zoomMin}}"
  zoom-max="{{zoomMax}}"
  zoom-step="{{zoomStep}}"
  zoom="{{zoom}}"
  last-photo="{{photo}}">
</app-media-image-capture>

<paper-slider
  min="[[zoomMin]]"
  max="[[zoomMax]]"
  step="[[zoomStep]]"
  value="{{zoom}}">
</paper-slider>

app-media-recorder throws error when stream is null

Description

app-media-stream sets its stream property to null if active gets set to false.

app-media-recorder tries to re-compute the recorder property with a nullified stream. => throws error.

Expected outcome

No error.

Actual outcome

Uncaught TypeError: Failed to construct 'MediaRecorder': parameter 1 is not of type 'MediaStream'.

Steps to reproduce

Bind stream from app-media-stream to app-media-recorder.
Set active property of app-media-stream to false.

Modifications to track settings with HTML tags in <app-media-image-capture> not propagating

Description

Changing property in <app-media-image-capture> HTML element does not affect corresponding track property (e.g. white-balance-mode = "manual").

Expected outcome

Attempted to set whiteBalanceMode to "manual" from "continuous". Also tested with modifications to zoom and contrast.

Actual outcome

No discernible change was detected in the capture view stream. Setting values manually in console using applyConstraints on videoTrack produced expected results. Issue seems to be isolated in setTrackConstraints call within updateTrackConstraints.

Live Demo

Steps to reproduce

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.