Coder Social home page Coder Social logo

Improve usability about getusermedia.js HOT 7 CLOSED

addyosmani avatar addyosmani commented on July 29, 2024
Improve usability

from getusermedia.js.

Comments (7)

franzenzenhofer avatar franzenzenhofer commented on July 29, 2024

given the different implementations of the different vendors i'm currently thinking about coding a lib ontop of this lib. the lib i have in mind would be simple

  • getUserVideo(success, error)
  • getUserAudio(success, error)

but the success callback would not (only) get the stream object, but a ready to use <video> or <audio> HTML element.

the callback would be something like this

onSuccess = function(videoEl, stream) {
//do some stuff with the videoEl
//or go low level with the stream thingie
}

<video> and <audio> are pretty standardized over all modern browser and every dev. (by now) knows how to use them.

otherwise it will take ages until getUserMedia will get any mainstream adoption.

just my 2c on the usability topic

from getusermedia.js.

addyosmani avatar addyosmani commented on July 29, 2024

@franzenzenhofer If there are any other changes to the overall API that you would like to suggest I'd be happy to consider them for inclusion. At the moment whilst the library itself is very usable, I feel like better abstractions could help people get setup to use it in less time.

from getusermedia.js.

franzenzenhofer avatar franzenzenhofer commented on July 29, 2024

started working on a simple (cross browser but no flash fallback ) getUserVideo function, see https://github.com/franzenzenhofer/Sinne feel free to drop by (the video demo already works https://github.com/franzenzenhofer/Sinne/blob/master/demo/video.html )

from getusermedia.js.

addyosmani avatar addyosmani commented on July 29, 2024

@franzenzenhofer Awesome. I'll take a look! Our projects could work together. e.g eventually if yours was fleshed out enough, could drop the gUM logic in mine to consume yours and just use getUserMedia.js as a bridge to the fallback.

Will try to provide feedback.

from getusermedia.js.

franzenzenhofer avatar franzenzenhofer commented on July 29, 2024

hi, i published https://github.com/franzenzenhofer/Sinne as V1, currently is uses the same logic a getUserMedia.js (rewritten in coffeescript), but yeah in the future it will make sense to use getUserMedia.noFallback.js directly.

in the current implementation i don't see a way to use the flash fallback in an non-"OMG it's flash i have to implement a complete other logic for this"-way.

i was thinking on how making a flash fallback feasible and non-disturbing, but the only way i could imagine was that we have to treat the flash-object as a kind of allow-bar.

  • display the flash-thingie
  • users clicks on "ok" for the video access
  • flash thingie gets hidden
  • flash thingie video stream gets funneled into a MediaStream (or whatever stream we need) object
  • success callback gets called (with the stream)

as i happily gave up on flash in 2004, i wonder if such a logic "flash thingie video stream -> MediaStream" is feasible?

from getusermedia.js.

addyosmani avatar addyosmani commented on July 29, 2024

Correct me if I've misinterpreted: Do you mean a way to display the Flash fallback in such a way that its completely (as in even from a UI perspective) transparent to the user what you're actually using behind the scenes? :)

If this is correct, there are a few challenges with it:

  • Chrome/Other browsers to the best of my knowledge don't support exposing the native notification/permissions bar for re-use. That said one could come up with something quite similar with CSS/HTML.
  • There unfortunately isn't a way to override the Flash permissions dialog. People have found workarounds for this in the past, but because there were security implications of it those holes allowing it have been patched. One might be able to hide the permissions dialog button beneath something custom, but I wonder how well that might work.

From a usability perspective, because there's a noFallback version of the shim hosted in the repo at the moment, I'm wondering whether or not to implement the Flash fallback part as a plugin that gets optionally included in the build process. Beyond that I think it'll be down to making gUM more easy to use.

from getusermedia.js.

franzenzenhofer avatar franzenzenhofer commented on July 29, 2024

hi

Do you mean a way to display the Flash fallback in such a way that its completely (as in even from a UI perspective) transparent to the user what you're actually using behind the scenes? :)

no, not "completely", i mean a flow like this

  • gerUserMedias.js getUserMedia(options, successCallback, errorCallback) gets called
  • detects that there is no native getUserMedia()
  • creates flash object
  • display (gray rectangle) flash object - with permission dialogue
  • user clicks "allow camera"
  • hides (gray rectangle) flash object
  • the flash (user webcam) video gets funneled into a MediaStream (or a MediaStream like) object
  • successCallback(stream) gets called

basically we only display the flash gray rectangle object for the permission dialogue - convert whatever flash gives us into a mediastream like object - call the successCallback

what i don't know, and what i want to find out (but i don't know who to ask), is, if this part "the flash (user webcam) video gets funneled into a MediaStream (or a MediaStream like) object" is in any way feasible?

gUM more easy to use.
working on it

from getusermedia.js.

Related Issues (20)

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.