A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://Tarektouati.github.io/vue-use-web/functions/device-media.html below:

Website Navigation


Device Media | useWeb

The MediaDevices interface provides access to connected media input devices like cameras and microphones, as well as screen sharing. In essence, it lets you obtain access to any hardware source of media data..

# State
import { useDeviceMedia } from 'vue-use-web';

const { stream } = useUserMedia({ audio: false, video: true });

useDeviceMedia returns a 2 values:

State Type Description stream Ref<MediaStream> Audio and video stream. error Ref<Error> An error message in case mediaDevices API # Example
<template>
  <video controls ref="videoElement"></video>
</template>

<script>
import { ref } from '@vue/composition-api';
import { useDeviceMedia } from 'vue-use-web';

export default {
  setup() {
    const { stream, error } = useUserMedia({ audio: true, video: true });
    const videoElement = ref(null);
    return { stream, error, videoElement };
  }
};
</script>
# Demo

TODO: Add cool live example!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4