barbican-reset 2.16.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.
@@ -1,16 +1,11 @@
1
1
  <template>
2
2
 
3
3
  <div>
4
-
5
- <fluid-iframe v-if="data.type === 'jwplayer'" :src="data.url" />
6
-
7
- <template v-if="data.type === 'brightcove'">
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.expires">
20
+ <template v-if="data.expiry">
26
21
 
27
- <p>Until {{ formatDateTime(data.expires) }}</p>
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
- concert: {
52
- type: Boolean,
53
- default: false,
46
+ },
47
+ data() {
48
+ return {
49
+ videoJsPlayer: null
54
50
  }
55
51
  },
56
- created() {
57
- if (this.concert) {
58
- this.data.expires = this.data.brightcove.expires;
59
- this.data.markup = this.data.brightcove.markup;
60
- this.data.script = this.data.brightcove.script;
61
- this.data.isExpired = this.data.brightcove.isExpired;
52
+ computed: {
53
+ shouldPlayVideo() {
54
+ if (this.data.source) {
55
+ return true;
56
+ }
57
+ return false;
62
58
  }
63
59
  },
64
- components: { FluidIframe, BrAlert },
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>
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.16.0"
58
+ "version": "2.16.1"
58
59
  }
package/scss/index.scss CHANGED
@@ -2,6 +2,7 @@
2
2
  @import "node_modules/bootstrap/scss/variables";
3
3
  @import "node_modules/bootstrap/scss/mixins";
4
4
  @import "../helpers/index";
5
+ @import "node_modules/video.js/src/css/video-js";
5
6
 
6
7
  @import "app";
7
8
  @import "header";