feat:初始化项目
This commit is contained in:
commit
c37c514828
18 files changed
+16542
No files matched your search
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div class="about">
|
||||
<h1>This is an about page</h1>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,45 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<video autoplay></video>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// @ is an alias to /src
|
||||
// import HelloWorld from "@/components/HelloWorld.vue";
|
||||
|
||||
export default {
|
||||
name: "Home",
|
||||
components: {
|
||||
// HelloWorld,
|
||||
},
|
||||
created() {
|
||||
// this.init();
|
||||
console.log("0000");
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
navigator.getUserMedia(
|
||||
{ video: true, audio: true },
|
||||
(localMediaStream) => {
|
||||
const video = document.querySelector("video");
|
||||
// video.srcObject = localMediaStream;
|
||||
try {
|
||||
video.srcObject = localMediaStream;
|
||||
} catch (error) {
|
||||
video.src = window.URL.createObjectURL(localMediaStream);
|
||||
}
|
||||
video.onloadedmetadata = (e) => {
|
||||
// Ready to go. Do some stuff.
|
||||
console.log("onloadedmetadata", e);
|
||||
};
|
||||
},
|
||||
this.errorCallback
|
||||
);
|
||||
},
|
||||
errorCallback(e) {
|
||||
console.log("Error", e);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in new issue
Block a user