# Device Media

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

  <video controls ref="videoElement"></video>

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 };

# Demo

TODO: Add cool live example!