解决ios无法识别问题
This commit is contained in:
parent
fb1d34bcf4
commit
5a4a777d03
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user