barbican-reset 2.15.0 → 2.16.1
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 +45 -34
- package/helpers/mixins/_buttons.scss +19 -15
- package/package.json +2 -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,64 @@
|
|
|
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";
|
|
45
40
|
|
|
46
41
|
export default {
|
|
47
42
|
props: {
|
|
48
43
|
data: {
|
|
49
44
|
type: Object
|
|
50
45
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
},
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
videoJsPlayer: null
|
|
54
50
|
}
|
|
55
51
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.data.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
computed: {
|
|
53
|
+
shouldPlayVideo() {
|
|
54
|
+
if (this.data.source) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
62
58
|
}
|
|
63
59
|
},
|
|
64
|
-
|
|
60
|
+
mounted() {
|
|
61
|
+
if (this.shouldPlayVideo) {
|
|
62
|
+
let options = {
|
|
63
|
+
controls: true,
|
|
64
|
+
fluid: true,
|
|
65
|
+
sources: [
|
|
66
|
+
{
|
|
67
|
+
src: this.data.source,
|
|
68
|
+
type: 'application/x-mpegURL'
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
this.$nextTick(() => {
|
|
73
|
+
this.player = videojs(this.$refs.videoPlayer, options, () => {
|
|
74
|
+
this.player.log('onPlayerReady', this);
|
|
75
|
+
console.log('player loaded', options);
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
components: { BrAlert },
|
|
65
81
|
methods: {
|
|
66
82
|
formatDateTime(date) {
|
|
67
83
|
return DateTime.fromISO(date).toFormat('h:mm a ccc d LLL yyyy');
|
|
68
84
|
}
|
|
85
|
+
},
|
|
86
|
+
beforeDestroy() {
|
|
87
|
+
if (this.videoJsPlayer) {
|
|
88
|
+
this.videoJsPlayer.dispose();
|
|
89
|
+
}
|
|
69
90
|
}
|
|
70
91
|
}
|
|
71
92
|
</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>
|
|
@@ -88,11 +88,13 @@
|
|
|
88
88
|
fill: currentColor;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
@include
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
&:not(:disabled) {
|
|
92
|
+
@include focus {
|
|
93
|
+
@include double-box($color, $background);
|
|
94
|
+
border: $border solid $background;
|
|
95
|
+
background-color: $background;
|
|
96
|
+
color: $color;
|
|
97
|
+
}
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
&.hide {
|
|
@@ -130,15 +132,17 @@
|
|
|
130
132
|
fill: currentColor;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
&:not(:disabled) {
|
|
136
|
+
@include focus {
|
|
137
|
+
border: $border solid $color;
|
|
138
|
+
background-color: $color;
|
|
139
|
+
color: $background;
|
|
140
|
+
box-shadow: none;
|
|
141
|
+
outline: none;
|
|
142
|
+
|
|
143
|
+
path {
|
|
144
|
+
fill: $background;
|
|
145
|
+
}
|
|
142
146
|
}
|
|
143
147
|
}
|
|
144
148
|
}
|
|
@@ -169,7 +173,7 @@
|
|
|
169
173
|
@include solid-button;
|
|
170
174
|
min-width: 8rem;
|
|
171
175
|
|
|
172
|
-
|
|
176
|
+
@include disabled {
|
|
173
177
|
@include solid-button($c-grey-l21);
|
|
174
178
|
cursor: not-allowed;
|
|
175
179
|
}
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"pug": "^3.0.2",
|
|
22
22
|
"sass": "^1.41.0",
|
|
23
23
|
"save-dev": "^0.0.1-security",
|
|
24
|
+
"video.js": "^8.6.1",
|
|
24
25
|
"vue-slick-carousel": "^1.0.6"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"watch:patterns": "cd patterns && gulp watch"
|
|
55
56
|
},
|
|
56
57
|
"style": "dist/css/barbican-reset.css",
|
|
57
|
-
"version": "2.
|
|
58
|
+
"version": "2.16.1"
|
|
58
59
|
}
|