barbican-reset 2.16.0 → 2.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/video_content.vue +51 -34
- package/package.json +3 -1
- package/scss/index.scss +1 -0
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<div>
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<div v-html="data.markup" :class="$style.brightcove"></div>
|
|
10
|
-
|
|
11
|
-
<br-alert v-if="data.isExpired" error center inline>Event has passed.</br-alert>
|
|
12
|
-
|
|
13
|
-
</template>
|
|
4
|
+
<br-alert v-if="data.isExpired" error center inline>Event has passed.</br-alert>
|
|
5
|
+
<br-alert v-if="data.status === 'not_found'" error center inline>That video cannot be found.</br-alert>
|
|
6
|
+
<div v-if="shouldPlayVideo">
|
|
7
|
+
<video ref="videoPlayer" class="video-js margin-bottom-2"></video>
|
|
8
|
+
</div>
|
|
14
9
|
|
|
15
10
|
<h2 v-html="data.title" class="margin-bottom-1"></h2>
|
|
16
11
|
|
|
@@ -22,9 +17,9 @@
|
|
|
22
17
|
|
|
23
18
|
</template>
|
|
24
19
|
|
|
25
|
-
<template v-if="data.
|
|
20
|
+
<template v-if="data.expiry">
|
|
26
21
|
|
|
27
|
-
<p>Until {{ formatDateTime(data.
|
|
22
|
+
<p>Until {{ formatDateTime(data.expiry) }}</p>
|
|
28
23
|
|
|
29
24
|
</template>
|
|
30
25
|
|
|
@@ -34,48 +29,70 @@
|
|
|
34
29
|
|
|
35
30
|
</template>
|
|
36
31
|
|
|
37
|
-
</div>
|
|
32
|
+
</div>
|
|
38
33
|
|
|
39
34
|
</template>
|
|
40
35
|
|
|
41
36
|
<script>
|
|
42
|
-
import { FluidIframe } from 'barbican-reset'
|
|
43
37
|
import BrAlert from './br_alert'
|
|
44
38
|
import { DateTime } from 'luxon';
|
|
39
|
+
import videojs from "video.js";
|
|
40
|
+
require('@silvermine/videojs-airplay')(videojs);
|
|
45
41
|
|
|
46
42
|
export default {
|
|
47
43
|
props: {
|
|
48
44
|
data: {
|
|
49
45
|
type: Object
|
|
50
46
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
videoJsPlayer: null
|
|
54
51
|
}
|
|
55
52
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.data.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
computed: {
|
|
54
|
+
shouldPlayVideo() {
|
|
55
|
+
if (this.data.source) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
62
59
|
}
|
|
63
60
|
},
|
|
64
|
-
|
|
61
|
+
mounted() {
|
|
62
|
+
if (this.shouldPlayVideo) {
|
|
63
|
+
let options = {
|
|
64
|
+
controls: true,
|
|
65
|
+
fluid: true,
|
|
66
|
+
sources: [
|
|
67
|
+
{
|
|
68
|
+
src: this.data.source,
|
|
69
|
+
type: 'application/x-mpegURL'
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
plugins: {
|
|
73
|
+
airPlay: {
|
|
74
|
+
addButtonToControlBar: true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.$nextTick(() => {
|
|
79
|
+
this.player = videojs(this.$refs.videoPlayer, options, () => {
|
|
80
|
+
this.player.log('onPlayerReady', this);
|
|
81
|
+
console.log('player loaded', options);
|
|
82
|
+
});
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
components: { BrAlert },
|
|
65
87
|
methods: {
|
|
66
88
|
formatDateTime(date) {
|
|
67
89
|
return DateTime.fromISO(date).toFormat('h:mm a ccc d LLL yyyy');
|
|
68
90
|
}
|
|
91
|
+
},
|
|
92
|
+
beforeDestroy() {
|
|
93
|
+
if (this.videoJsPlayer) {
|
|
94
|
+
this.videoJsPlayer.dispose();
|
|
95
|
+
}
|
|
69
96
|
}
|
|
70
97
|
}
|
|
71
98
|
</script>
|
|
72
|
-
|
|
73
|
-
<style lang="scss" module>
|
|
74
|
-
|
|
75
|
-
.brightcove {
|
|
76
|
-
border-radius: $border-radius-lg;
|
|
77
|
-
margin-bottom: 2rem;
|
|
78
|
-
overflow: hidden;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
</style>
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"name": "Paul Heading"
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
|
+
"@silvermine/videojs-airplay": "^1.3.0",
|
|
6
7
|
"bootstrap-vue": "^2.21.2",
|
|
7
8
|
"express": "^4.18.1",
|
|
8
9
|
"focus-visible": "^5.2.0",
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
"pug": "^3.0.2",
|
|
22
23
|
"sass": "^1.41.0",
|
|
23
24
|
"save-dev": "^0.0.1-security",
|
|
25
|
+
"video.js": "^8.6.1",
|
|
24
26
|
"vue-slick-carousel": "^1.0.6"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
@@ -54,5 +56,5 @@
|
|
|
54
56
|
"watch:patterns": "cd patterns && gulp watch"
|
|
55
57
|
},
|
|
56
58
|
"style": "dist/css/barbican-reset.css",
|
|
57
|
-
"version": "2.16.
|
|
59
|
+
"version": "2.16.2"
|
|
58
60
|
}
|