Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:add demo video #562

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added apps/client/assets/demo-video.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions apps/client/components/Player/Player.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script setup lang="ts">
import { onMounted } from "vue";
import Player from "xgplayer";
import "xgplayer/dist/index.min.css";

import Poster from "~/assets/demo-video.png";

const props = defineProps({
videoUrl: String,
});

onMounted(() => {
let player = new Player({
id: "player",
url: props.videoUrl,
width: "85%",
height: 650,
poster: Poster,
videoFillMode: "fill",
commonStyle: {
playedColor: "#9d59ef",
volumeColor: "#9d59ef",
},
});
});
</script>

<template>
<div id="player"></div>
</template>

<style>
.xgplayer .xg-options-list li:hover,
.xgplayer .xg-options-list li.selected {
opacity: 1;
color: #9d59ef;
}
</style>
7 changes: 6 additions & 1 deletion apps/client/components/home/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,18 @@
src="~/assets/home-page-preview.png"
class="w-3/4"
/>

<!-- demo video show -->
<!-- <Player video-url="https://media.w3.org/2010/05/sintel/trailer.mp4"/> -->

</div>

<CommonDivider />
</section>
</template>

<script setup lang="ts">

const emit = defineEmits(["startEarthworm"]);

function handleKeydown() {
Expand Down Expand Up @@ -248,4 +253,4 @@ strong {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
}
}
</style>
</style>
1 change: 1 addition & 0 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"pinia": "^2.1.7",
"satori": "^0.10.13",
"vee-validate": "^4.12.5",
"xgplayer": "^3.0.16",
"yup": "^1.3.3"
}
}
Loading