Skip to content

Commit

Permalink
feat: fix ios camera preview bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Apr 22, 2024
1 parent d5005cb commit 4859cb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/Camera.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const loadCamera = (deviceId: ConstrainDOMString) => {
return;
};
video.value.srcObject = stream
video.value.onloadedmetadata = function (e) {
cameraView.play()
}
window.localStorage.setItem(deviceStorageToken, deviceId.toString())
})
Expand Down Expand Up @@ -202,7 +205,7 @@ defineExpose({
<template>
<div class="not-prose">

<video v-if="deviceId" ref="video" class="w-full object-contain" autoplay />
<video v-if="deviceId" ref="video" class="w-full object-contain" autoplay muted playsinline />
<div v-else>
<USkeleton class="w-[95vw] h-[85svh]" />
</div>
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default defineNuxtConfig({
name: 'SnapHold',
short_name: 'SnapHold',
theme_color: '#ffffff',
display: "standalone",
icons: [
{
src: 'pwa-192x192.png',
Expand Down

0 comments on commit 4859cb9

Please sign in to comment.