解决ios无法识别问题

This commit is contained in:
rucky 2021-12-28 18:20:39 +08:00
parent fb1d34bcf4
commit 5a4a777d03

View File

@ -260,12 +260,16 @@ export default {
const videoTracks = stream.getVideoTracks();
this.stream = stream; // make variable available to browser console
let streamSize = this.GetStreamDimensions(stream);
// let handledSize = this.ScaleResolutionToHeight(
// streamSize,
// window.innerHeight
// );
// this.videoRealSize = handledSize;
//
this.responseVideoAndCanvas();
let handledSize = this.ScaleResolutionToWidth(
{ width: this.video.width, height: this.video.height },
window.innerWidth
);
this.videoRealSize = handledSize;
console.log("Got stream with constraints:", constraints);
console.log(`Using video device: ${videoTracks[0].label}`);
@ -277,10 +281,9 @@ export default {
// handledSize
);
// this.responseVideoAndCanvas(handledSize);
this.video.srcObject = stream;
// this.video.play();
this.video.play();
//
this.startDraw();
@ -291,13 +294,12 @@ export default {
},
//
responseVideoAndCanvas(size) {
this.video.width = size.width;
this.video.height = size.height;
this.video.width = window.innerWidth;
this.video.height = window.innerHeight;
// init canvcas
this.ctx = this.canvas.getContext("2d");
this.canvas.width = size.width;
this.canvas.height = size.height;
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
},
// stream
GetStreamDimensions(stream) {
@ -540,8 +542,8 @@ export default {
align-content: center;
align-items: center;
.video {
// .paLayout(50%,50%,auto,100%,0);
// transform: translate(-50%, -50%);
.paLayout(50%,50%,auto,100%,0);
transform: translate(-50%, -50%);
// transform: scaleX(-1);
// width: 750px;
display: none;