xml code
<template>
<div>
<button class = "btn btn-primary" id = "button_id" t-attf-style = "width: 193px; height: 50px;" > Add Attribute </button>
<video id = "video" width = "720" hight = "560" autoplay = "autoplay" muted = "muted" >
</div>
</template>
javascript code:
odoo.define ( 'opencv_attendance.face_detection_video' , function (require) {
"use strict" ;events: {
"click .btn-primary" : "startVideo" ,
},const video = document.getElementById ( "video" )
function startVideo () {
alert ( "function block is executing" )
navigator.getUserMedia ({
video: {}},
stream => video.srcObject = stream,
err => console. error (err))
}
});