set default volume to 0.2

This commit is contained in:
2022-11-06 13:40:42 +09:00
parent d65ad01e56
commit 63b53b5096
2 changed files with 10 additions and 4 deletions

View File

@ -43,7 +43,8 @@ function volumechange() {
}
onMounted(() => {
if (audioEl) audioEl.volume = ColdDeviceStorage.get('mediaVolume');
// if (audioEl) audioEl.volume = ColdDeviceStorage.get('mediaVolume');
if (audioEl) audioEl.volume = 0.2;
});
</script>

View File

@ -14,8 +14,8 @@
controls
@contextmenu.stop
>
<source
:src="video.url"
<source
:src="video.url"
:type="video.type === 'video/quicktime' ? 'video/mp4' : video.type"
>
</video>
@ -24,7 +24,7 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { onMounted, ref } from 'vue';
import * as misskey from 'misskey-js';
import { defaultStore } from '@/store';
@ -32,7 +32,12 @@ const props = defineProps<{
video: misskey.entities.DriveFile;
}>();
const videoEl = $ref<HTMLVideoElement | null>();
const hide = ref((defaultStore.state.nsfw === 'force') ? true : props.video.isSensitive && (defaultStore.state.nsfw !== 'ignore'));
onMounted(() => {
if (videoEl) videoEl.volume = 0.2;
});
</script>
<style lang="scss" scoped>