Skip to content

Commit fd19e06

Browse files
author
Philipp
committed
Squashed commit of the following:
commit 1008c2f Author: Philipp <[email protected]> Date: Mon Sep 12 17:54:55 2022 +0200 NPM update commit a5a4b4d Author: Philipp <[email protected]> Date: Mon Sep 12 17:41:39 2022 +0200 Update README.md commit b2f6fbe Author: Philipp <[email protected]> Date: Mon Sep 12 17:35:41 2022 +0200 Update README.md commit a81e0b6 Author: Philipp <[email protected]> Date: Mon Sep 12 17:33:46 2022 +0200 Update vite.config.js commit 7262cf9 Author: Philipp <[email protected]> Date: Mon Sep 12 17:26:42 2022 +0200 Removing vue content WEIRD! Had to move Vue Content from index.html to App.vue. It's not working :( commit 61da247 Author: Philipp <[email protected]> Date: Mon Sep 12 17:21:00 2022 +0200 Creating Output Demo JS commit c345301 Author: Philipp <[email protected]> Date: Mon Sep 12 13:02:46 2022 +0200 Added favicon commit 18d835e Author: Philipp <[email protected]> Date: Sun Sep 11 18:54:01 2022 +0200 Vite Build Dist commit a4ae2b1 Author: Philipp <[email protected]> Date: Sun Sep 11 15:51:52 2022 +0200 Ignore Warning commit 6d5b453 Author: Philipp <[email protected]> Date: Sun Sep 11 11:43:35 2022 +0200 Vite Rollup commit a7f4959 Author: Philipp <[email protected]> Date: Fri Sep 9 19:05:58 2022 +0200 Installed Vite
1 parent cad5bcb commit fd19e06

File tree

16 files changed

+3822
-55826
lines changed

16 files changed

+3822
-55826
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
module.exports = {
22
extends: ['avidofood'],
3+
env: {
4+
es2021: true,
5+
},
36
};

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
node_modules/
1+
node_modules/
2+
3+
dist

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
```
4343

4444
### (3: Only for Nuxt.js users)
45+
#### Nuxt.js v2.xx.x
4546
>Thanks to [@skoulix](https://github.com/avidofood/vue-responsive-video-background-player/issues/8#issuecomment-654821213) for his instructions:
4647
4748
Again this is only for Nuxt.js users. Gridsome users click [here](https://gridsome.org/docs/assets-scripts/#without-ssr-support). At your `nuxt.config.js` locate the part where you declare your plugins and import the file. Example:
@@ -57,6 +58,22 @@ plugins: [
5758

5859
Now the component is globally available and can be used at any .vue file without issues.
5960

61+
#### Nuxt.js v3.xx.x
62+
>Thanks to [@Vertenz](https://github.com/avidofood/vue-responsive-video-background-player/issues/8#issuecomment-1192011721) for his instructions:
63+
64+
for NUXT 3 I used directive to make it work. Create **plugins** directory then add **video-bg.client.ts** _(or any name but **.client** is obligatory for client side render, cause you don't have the window at ssr)_ file with
65+
66+
```
67+
import { defineNuxtPlugin } from "#app";
68+
import { Plugin } from "vue-responsive-video-background-player";
69+
70+
export default defineNuxtPlugin((nuxtApp) => {
71+
nuxtApp.vueApp.use(Plugin);
72+
});
73+
```
74+
75+
then you use the **video-background** tag
76+
6077

6178
## Usage - (or to make it runnable 🏃‍♂️)
6279

@@ -103,14 +120,14 @@ This package is for responsive videos depicting different video resolution. Have
103120

104121
This is your path to your video. You can just use this value for showing your video in every resolution.
105122

106-
>⚠️**Warning** for [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html): You need to bind the source like this: `:src="require(``@/assets/video/timelapse.mp4``)"`. [Read here why](https://github.com/avidofood/vue-responsive-video-background-player/issues/10#issuecomment-646959090)
123+
>**Warning** for [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html): You need to bind the source like this: ``:src="require(`@/assets/video/timelapse.mp4`)"``. [Read here why](https://github.com/avidofood/vue-responsive-video-background-player/issues/10#issuecomment-646959090)
107124
108125

109126
- `poster` (default: `''`)
110127

111128
This is your first background image that is shown before the video is loaded.
112129

113-
>⚠️**Warning** for [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html): You need to bind the source like this: `:src="require(``@/assets/img/logo.png``)"`. [Read here why](https://github.com/avidofood/vue-responsive-video-background-player/issues/10#issuecomment-646959090)
130+
>**Warning** for [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html): You need to bind the source like this: ``:src="require(`@/assets/img/logo.png`)"``. [Read here why](https://github.com/avidofood/vue-responsive-video-background-player/issues/10#issuecomment-646959090)
114131
115132
- `sources` (default: `[]`)
116133

demo/public/build/js/app.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/public/js/app.js

Lines changed: 0 additions & 22963 deletions
This file was deleted.

demo/resources/js/App.vue

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<video-background
3+
class="video-container"
4+
src="/demo/public/videos/roadster-loop-imperial.mp4"
5+
overlay="linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(251, 148, 158, 0.22), rgba(251, 148, 158, 0.42))"
6+
:sources="[
7+
{src: '/demo/public/videos/accessories-hero-desktop.mp4', res: 991, autoplay: true},
8+
{src: '/demo/public/videos/power-hero-mobile.mp4', res: 575, autoplay: true, poster: '/demo/public/images/[email protected]'}
9+
]"
10+
>
11+
<div class="d-flex justify-content-center align-items-center h-50 px-2">
12+
<h4
13+
class="text-white text-center d-md-none"
14+
style="font-weight: 600;"
15+
>
16+
Vue Responsive Background Player
17+
</h4>
18+
<h1
19+
class="text-white d-none d-md-block"
20+
style="font-weight: 600;"
21+
>
22+
Vue Responsive Background Player
23+
</h1>
24+
</div>
25+
</video-background>
26+
27+
<section class="container text-center mt-3">
28+
<h6 class="text-light">
29+
Vue.js component
30+
</h6>
31+
<a
32+
class="btn btn-danger"
33+
href="https://github.com/avidofood/vue-responsive-video-background-player"
34+
role="button"
35+
>Source on GitHub</a>
36+
37+
<div class="social mt-4">
38+
<a
39+
href="https://twitter.com/share?ref_src=twsrc%5Etfw"
40+
class="twitter-share-button"
41+
data-show-count="false"
42+
>Tweet</a>
43+
<a
44+
class="github-button"
45+
href="https://github.com/avidofood/vue-responsive-video-background-player"
46+
data-show-count="true"
47+
aria-label="Star avidofood/vue-responsive-video-background-player on GitHub"
48+
>Star</a>
49+
</div>
50+
</section>
51+
52+
<section class="container mt-5">
53+
<div class="row">
54+
<div class="col-12 col-md-6">
55+
<h4
56+
class="text-white d-md-none"
57+
style="font-weight: 600;"
58+
>
59+
Designed for Vue 2 & 3
60+
</h4>
61+
<h2
62+
class="text-white d-none d-md-block"
63+
style="font-weight: 600; "
64+
>
65+
Designed for Vue 2 & 3
66+
</h2>
67+
</div>
68+
<div class="col-12 col-md-6">
69+
<p class="text-white">
70+
You can even change the video resolution with different breakpoints. Try it out, resize your window!
71+
</p>
72+
</div>
73+
</div>
74+
</section>
75+
</template>
76+
77+
<script setup>
78+
import VideoBackground from '../../../src/index';
79+
</script>

demo/resources/js/app.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import { createApp } from 'vue';
2-
import VideoBackground from '../../../src/index';
2+
import App from './App.vue';
33

4-
const app = createApp({});
5-
6-
app.component('VideoBackground', VideoBackground);
7-
8-
app.mount('#app');
4+
createApp(App).mount('#app');

0 commit comments

Comments
 (0)