webcam getCapabilities not supported on firefox
This commit is contained in:
parent
c7c91f87ba
commit
751f3deaab
1 changed files with 185 additions and 180 deletions
|
@ -6,7 +6,8 @@
|
||||||
<div class="modal" :class="{'d-block': show_modal}" tabindex="-1">
|
<div class="modal" :class="{'d-block': show_modal}" tabindex="-1">
|
||||||
<div class="modal-dialog modal-fullscreen">
|
<div class="modal-dialog modal-fullscreen">
|
||||||
<div class="modal-content p-2">
|
<div class="modal-content p-2">
|
||||||
<button type="button" class="btn-close position-absolute fixed-top m-2" style="right: 1rem; left: auto;"
|
<button type="button" class="btn-close position-absolute fixed-top m-2"
|
||||||
|
style="right: 1rem; left: auto;"
|
||||||
@click="close"></button>
|
@click="close"></button>
|
||||||
<div v-if="error" class="alert alert-danger" role="alert">
|
<div v-if="error" class="alert alert-danger" role="alert">
|
||||||
{{ lastError }}
|
{{ lastError }}
|
||||||
|
@ -100,12 +101,16 @@ export default {
|
||||||
if (this.stream) this.allowed = true;
|
if (this.stream) this.allowed = true;
|
||||||
},
|
},
|
||||||
async assignStream() {
|
async assignStream() {
|
||||||
|
console.log(this.stream.getTracks()[0]);
|
||||||
|
const track = this.stream.getTracks()[0];
|
||||||
|
if (track.getCapabilities) {
|
||||||
const capabilities = this.stream.getTracks()[0].getCapabilities();
|
const capabilities = this.stream.getTracks()[0].getCapabilities();
|
||||||
await this.attemptGetUserMedia({
|
await this.attemptGetUserMedia({
|
||||||
deviceId: capabilities.deviceId,
|
deviceId: capabilities.deviceId,
|
||||||
width: {exact: capabilities.width.max},
|
width: {ideal: capabilities.width.max},
|
||||||
height: {exact: capabilities.height.max}
|
height: {ideal: capabilities.height.max}
|
||||||
})
|
});
|
||||||
|
}
|
||||||
this.capturing = true;
|
this.capturing = true;
|
||||||
this.streaming = false;
|
this.streaming = false;
|
||||||
const {video} = this.$refs;
|
const {video} = this.$refs;
|
||||||
|
|
Loading…
Reference in a new issue