解决ios无法识别问题
This commit is contained in:
parent
fb1d34bcf4
commit
5a4a777d03
@ -260,12 +260,16 @@ export default {
|
|||||||
const videoTracks = stream.getVideoTracks();
|
const videoTracks = stream.getVideoTracks();
|
||||||
this.stream = stream; // make variable available to browser console
|
this.stream = stream; // make variable available to browser console
|
||||||
let streamSize = this.GetStreamDimensions(stream);
|
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("Got stream with constraints:", constraints);
|
||||||
console.log(`Using video device: ${videoTracks[0].label}`);
|
console.log(`Using video device: ${videoTracks[0].label}`);
|
||||||
@ -277,10 +281,9 @@ export default {
|
|||||||
// handledSize
|
// handledSize
|
||||||
);
|
);
|
||||||
|
|
||||||
// this.responseVideoAndCanvas(handledSize);
|
|
||||||
this.video.srcObject = stream;
|
this.video.srcObject = stream;
|
||||||
|
|
||||||
// this.video.play();
|
this.video.play();
|
||||||
|
|
||||||
// 开始识别
|
// 开始识别
|
||||||
this.startDraw();
|
this.startDraw();
|
||||||
@ -291,13 +294,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 视频设置
|
// 视频设置
|
||||||
responseVideoAndCanvas(size) {
|
responseVideoAndCanvas(size) {
|
||||||
this.video.width = size.width;
|
this.video.width = window.innerWidth;
|
||||||
this.video.height = size.height;
|
this.video.height = window.innerHeight;
|
||||||
|
|
||||||
// init canvcas
|
// init canvcas
|
||||||
this.ctx = this.canvas.getContext("2d");
|
this.ctx = this.canvas.getContext("2d");
|
||||||
this.canvas.width = size.width;
|
this.canvas.width = window.innerWidth;
|
||||||
this.canvas.height = size.height;
|
this.canvas.height = window.innerHeight;
|
||||||
},
|
},
|
||||||
// 获得stream大小
|
// 获得stream大小
|
||||||
GetStreamDimensions(stream) {
|
GetStreamDimensions(stream) {
|
||||||
@ -540,8 +542,8 @@ export default {
|
|||||||
align-content: center;
|
align-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.video {
|
.video {
|
||||||
// .paLayout(50%,50%,auto,100%,0);
|
.paLayout(50%,50%,auto,100%,0);
|
||||||
// transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
// transform: scaleX(-1);
|
// transform: scaleX(-1);
|
||||||
// width: 750px;
|
// width: 750px;
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user