polymerelements / app-media Goto Github PK
View Code? Open in Web Editor NEWElements for accessing data from media input devices and visualizing that data for users
Elements for accessing data from media input devices and visualizing that data for users
As a camera app author,
When I implement camera switching,
I want unambiguous control over which camera to use,
so that I can pick the right camera at the right time.
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.
Ability to customize bitrate options
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.
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.
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.
Only tested on latest stable Chrome.
Shouldn't demo/index.html
import polymer.html
? π€
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!!!!
@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β¦ π
I've updated app-media
to the latest version and video-constraints='{"facingMode":"environment"}'
no longer works.
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
A Web UI element that we could select the device (microphone)
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.
https://www.webcomponents.org/element/@polymer/app-media/demo/demo/index.html
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.).
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
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)
Each call to takePhoto() should take a new photo.
Only the first takePhoto call works in Polymer 2.
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?
Safari 11 has shipped many user media APIs. Firefox also seems to have MediaRecorder.
app-media-image capture raises 'ImageCapture instance not ready' error
Should display the content that the camera is streaming
No content is being displayed and error appears.
app-media-devices
componentapp-media-stream
componentapp-media-image-capture
componentTested on Chrome.
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(); }
As a camera app user,
When I switch from front to back camera,
I want the recorder to record a contiguous video,
So that I don't need to combine separate videos later.
Is it possible to control the videos ? likepause/unpause
or slide video duration
etc ?
The app-media-recorder
element is not recording in proper .wav
file format.
The element should generate a valid WAV format with LPCM audio for maximum audio quality.
The element records in audio/webm
, even if you specify mime-type="audio/wav"
.
app-media-recorder
element in the page.mime-type="audio/wav"
app-media-recorder
element.app-media-image-capture can't set the track constraints
Should set the constraints when setting the constraint property.
Nothing changed when I set constraint property.
Tested on Chrome of Pixel
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-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.
No error.
Uncaught TypeError: Failed to construct 'MediaRecorder': parameter 1 is not of type 'MediaStream'.
Bind stream
from app-media-stream
to app-media-recorder
.
Set active
property of app-media-stream
to false
.
Changing property in <app-media-image-capture>
HTML element does not affect corresponding track property (e.g. white-balance-mode = "manual"
).
Attempted to set whiteBalanceMode to "manual" from "continuous". Also tested with modifications to zoom and contrast.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.