@mjhls/mjh-framework 1.0.430 → 1.0.431

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/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
 
2
-
3
- # mjh-framework v. 1.0.430
4
-
2
+ # mjh-framework v. 1.0.431
5
3
 
6
4
  > Foundation Framework
7
5
 
package/dist/cjs/index.js CHANGED
@@ -8114,7 +8114,9 @@ var Video = function Video(_ref) {
8114
8114
  var node = _ref.node,
8115
8115
  accountIDs = _ref.accountIDs,
8116
8116
  _ref$autoplay = _ref.autoplay,
8117
- autoplay = _ref$autoplay === undefined ? false : _ref$autoplay;
8117
+ autoplay = _ref$autoplay === undefined ? false : _ref$autoplay,
8118
+ _ref$autoplayNextVide = _ref.autoplayNextVideo,
8119
+ autoplayNextVideo = _ref$autoplayNextVide === undefined ? function () {} : _ref$autoplayNextVide;
8118
8120
  var source = node.source,
8119
8121
  videoID = node.videoID,
8120
8122
  playlistID = node.playlistID,
@@ -8125,10 +8127,10 @@ var Video = function Video(_ref) {
8125
8127
  //console.log('success:', success.ref)
8126
8128
  var player = success.ref;
8127
8129
 
8128
- // this is video ready
8130
+ // this is video ready
8129
8131
  player.on('loadedmetadata', function (evt) {
8130
8132
  //console.log('loadedmetadata:', evt)
8131
- console.log('mediainfo:', player.mediainfo); // get the duration from here
8133
+ console.log('mediainfo:', player.mediainfo); // get the duration from here
8132
8134
  var duration = player.mediainfo.duration;
8133
8135
  var current = player.currentTime();
8134
8136
  var queue = Math.floor(duration / 10);
@@ -8159,7 +8161,7 @@ var Video = function Video(_ref) {
8159
8161
  AdSlot.Beam.report_beam_video('Play', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8160
8162
  });
8161
8163
 
8162
- // pause
8164
+ // pause
8163
8165
  player.on('pause', function (evt) {
8164
8166
  var duration = player.mediainfo.duration;
8165
8167
  var current = player.currentTime();
@@ -8175,6 +8177,7 @@ var Video = function Video(_ref) {
8175
8177
  var queue = Math.floor(duration / 10);
8176
8178
  var segment = Math.floor(current / queue);
8177
8179
  AdSlot.Beam.report_beam_video('End', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8180
+ autoplayNextVideo(evt);
8178
8181
  });
8179
8182
 
8180
8183
  var queueProgress = [];
@@ -8189,7 +8192,7 @@ var Video = function Video(_ref) {
8189
8192
  }
8190
8193
  });
8191
8194
 
8192
- // ad impression
8195
+ // ad impression
8193
8196
  player.on('ads-ad-started', function (evt) {
8194
8197
  var duration = player.ads.ad.duration;
8195
8198
  var id = player.ads.ad.id;
@@ -8198,7 +8201,7 @@ var Video = function Video(_ref) {
8198
8201
  AdSlot.Beam.report_beam_ad('AD Started', main.main_16, '', '', '', '', '', adType, duration, id);
8199
8202
  });
8200
8203
 
8201
- // ad ended
8204
+ // ad ended
8202
8205
  player.on('ads-ad-ended', function (evt) {
8203
8206
  var duration = player.ads.ad.duration;
8204
8207
  var id = player.ads.ad.id;
@@ -8209,15 +8212,39 @@ var Video = function Video(_ref) {
8209
8212
 
8210
8213
  if (source === 'brightcove' && accountIDs.brightcove) {
8211
8214
  if (videoID) {
8212
- return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove', autoplay: 'muted' } });
8215
+ return React__default.createElement(
8216
+ 'div',
8217
+ null,
8218
+ React__default.createElement(ReactPlayerLoader, {
8219
+ onSuccess: onVideoSuccess,
8220
+ accountId: accountIDs.brightcove.accountId,
8221
+ videoId: videoID,
8222
+ playerId: accountIDs.brightcove.playerId,
8223
+ attrs: { className: 'brightcove', autoplay: 'muted' }
8224
+ }),
8225
+ React__default.createElement(
8226
+ 'style',
8227
+ { jsx: 'true' },
8228
+ '\n .brightcove {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n width: 100%;\n }\n .brightcove .video-js {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n '
8229
+ )
8230
+ );
8213
8231
  } else if (playlistID) {
8214
- return React__default.createElement(ReactPlayerLoader, {
8215
- accountId: accountIDs.brightcove.accountId,
8216
- playlistId: playlistID,
8217
- playerId: accountIDs.brightcove.playerId,
8218
- onSuccess: onVideoSuccess,
8219
- attrs: { className: 'brightcove brightcove-playlist', autoplay: 'muted' }
8220
- });
8232
+ return React__default.createElement(
8233
+ 'div',
8234
+ null,
8235
+ React__default.createElement(ReactPlayerLoader, {
8236
+ accountId: accountIDs.brightcove.accountId,
8237
+ playlistId: playlistID,
8238
+ playerId: accountIDs.brightcove.playerId,
8239
+ onSuccess: onVideoSuccess,
8240
+ attrs: { className: 'brightcove brightcove-playlist', autoplay: 'muted' }
8241
+ }),
8242
+ React__default.createElement(
8243
+ 'style',
8244
+ { jsx: 'true' },
8245
+ '\n .brightcove {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n width: 100%;\n }\n .brightcove .video-js {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n '
8246
+ )
8247
+ );
8221
8248
  } else if (experienceID) {
8222
8249
  return React__default.createElement(
8223
8250
  'div',
@@ -13044,6 +13071,27 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
13044
13071
  setState(nodes.videos[nextVid].url, '', nextVid + 1);
13045
13072
  }
13046
13073
 
13074
+ var autoplayNextVideo = function autoplayNextVideo(e) {
13075
+ //for brightcove videos
13076
+
13077
+ var currentVid = void 0;
13078
+ var nextVid = void 0;
13079
+ //Find index of video currently playing
13080
+ seriesData.forEach(function (vid, index) {
13081
+ if (vid.url === vidUrl) {
13082
+ currentVid = index;
13083
+ }
13084
+ });
13085
+ //increment +1, or if at the end of the series list, go back to the beginning
13086
+ if (currentVid + 1 >= seriesData.length) {
13087
+ nextVid = 0;
13088
+ } else {
13089
+ nextVid = currentVid + 1;
13090
+ }
13091
+ // set the new Video URL
13092
+ setState(nodes.videos[nextVid].url, '', nextVid + 1);
13093
+ };
13094
+
13047
13095
  var handlePlayPercent = function handlePlayPercent(player) {
13048
13096
  var current = player.getCurrentTime();
13049
13097
  var duration = player.getDuration();
@@ -13110,7 +13158,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
13110
13158
  }
13111
13159
  }),
13112
13160
  vidUrl && vidType == 'mp4' && React__default.createElement(VideoMp4, { url: vidUrl, thumbnail: vidThumbnail, vidLoaded: vidLoaded }),
13113
- vidUrl && vidType == 'brightcove' && React__default.createElement(Video, { node: { videoID: vidUrl, source: 'brightcove' }, accountIDs: accountIDs }),
13161
+ vidUrl && vidType == 'brightcove' && React__default.createElement(Video, { autoplay: true, node: { videoID: vidUrl, source: 'brightcove' }, accountIDs: accountIDs, autoplayNextVideo: autoplayNextVideo }),
13114
13162
  React__default.createElement(
13115
13163
  'div',
13116
13164
  {
@@ -13162,7 +13210,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
13162
13210
  React__default.createElement(
13163
13211
  'style',
13164
13212
  { jsx: 'true' },
13165
- '\n \n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n .brightcove .video-js {\n float: none;\n width: 100%;\n height: 385px;\n }\n @media screen and (max-width: 1399px) {\n .brightcove .video-js {\n height: 360px;\n }\n }\n @media screen and (max-width: 495px) {\n .brightcove .video-js {\n height: 255px;\n }\n }\n '
13213
+ '\n \n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n \n \n '
13166
13214
  )
13167
13215
  );
13168
13216
  };
package/dist/esm/index.js CHANGED
@@ -8111,7 +8111,9 @@ var Video = function Video(_ref) {
8111
8111
  var node = _ref.node,
8112
8112
  accountIDs = _ref.accountIDs,
8113
8113
  _ref$autoplay = _ref.autoplay,
8114
- autoplay = _ref$autoplay === undefined ? false : _ref$autoplay;
8114
+ autoplay = _ref$autoplay === undefined ? false : _ref$autoplay,
8115
+ _ref$autoplayNextVide = _ref.autoplayNextVideo,
8116
+ autoplayNextVideo = _ref$autoplayNextVide === undefined ? function () {} : _ref$autoplayNextVide;
8115
8117
  var source = node.source,
8116
8118
  videoID = node.videoID,
8117
8119
  playlistID = node.playlistID,
@@ -8122,10 +8124,10 @@ var Video = function Video(_ref) {
8122
8124
  //console.log('success:', success.ref)
8123
8125
  var player = success.ref;
8124
8126
 
8125
- // this is video ready
8127
+ // this is video ready
8126
8128
  player.on('loadedmetadata', function (evt) {
8127
8129
  //console.log('loadedmetadata:', evt)
8128
- console.log('mediainfo:', player.mediainfo); // get the duration from here
8130
+ console.log('mediainfo:', player.mediainfo); // get the duration from here
8129
8131
  var duration = player.mediainfo.duration;
8130
8132
  var current = player.currentTime();
8131
8133
  var queue = Math.floor(duration / 10);
@@ -8156,7 +8158,7 @@ var Video = function Video(_ref) {
8156
8158
  Beam.report_beam_video('Play', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8157
8159
  });
8158
8160
 
8159
- // pause
8161
+ // pause
8160
8162
  player.on('pause', function (evt) {
8161
8163
  var duration = player.mediainfo.duration;
8162
8164
  var current = player.currentTime();
@@ -8172,6 +8174,7 @@ var Video = function Video(_ref) {
8172
8174
  var queue = Math.floor(duration / 10);
8173
8175
  var segment = Math.floor(current / queue);
8174
8176
  Beam.report_beam_video('End', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8177
+ autoplayNextVideo(evt);
8175
8178
  });
8176
8179
 
8177
8180
  var queueProgress = [];
@@ -8186,7 +8189,7 @@ var Video = function Video(_ref) {
8186
8189
  }
8187
8190
  });
8188
8191
 
8189
- // ad impression
8192
+ // ad impression
8190
8193
  player.on('ads-ad-started', function (evt) {
8191
8194
  var duration = player.ads.ad.duration;
8192
8195
  var id = player.ads.ad.id;
@@ -8195,7 +8198,7 @@ var Video = function Video(_ref) {
8195
8198
  Beam.report_beam_ad('AD Started', main_16, '', '', '', '', '', adType, duration, id);
8196
8199
  });
8197
8200
 
8198
- // ad ended
8201
+ // ad ended
8199
8202
  player.on('ads-ad-ended', function (evt) {
8200
8203
  var duration = player.ads.ad.duration;
8201
8204
  var id = player.ads.ad.id;
@@ -8206,15 +8209,39 @@ var Video = function Video(_ref) {
8206
8209
 
8207
8210
  if (source === 'brightcove' && accountIDs.brightcove) {
8208
8211
  if (videoID) {
8209
- return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove', autoplay: 'muted' } });
8212
+ return React__default.createElement(
8213
+ 'div',
8214
+ null,
8215
+ React__default.createElement(ReactPlayerLoader, {
8216
+ onSuccess: onVideoSuccess,
8217
+ accountId: accountIDs.brightcove.accountId,
8218
+ videoId: videoID,
8219
+ playerId: accountIDs.brightcove.playerId,
8220
+ attrs: { className: 'brightcove', autoplay: 'muted' }
8221
+ }),
8222
+ React__default.createElement(
8223
+ 'style',
8224
+ { jsx: 'true' },
8225
+ '\n .brightcove {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n width: 100%;\n }\n .brightcove .video-js {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n '
8226
+ )
8227
+ );
8210
8228
  } else if (playlistID) {
8211
- return React__default.createElement(ReactPlayerLoader, {
8212
- accountId: accountIDs.brightcove.accountId,
8213
- playlistId: playlistID,
8214
- playerId: accountIDs.brightcove.playerId,
8215
- onSuccess: onVideoSuccess,
8216
- attrs: { className: 'brightcove brightcove-playlist', autoplay: 'muted' }
8217
- });
8229
+ return React__default.createElement(
8230
+ 'div',
8231
+ null,
8232
+ React__default.createElement(ReactPlayerLoader, {
8233
+ accountId: accountIDs.brightcove.accountId,
8234
+ playlistId: playlistID,
8235
+ playerId: accountIDs.brightcove.playerId,
8236
+ onSuccess: onVideoSuccess,
8237
+ attrs: { className: 'brightcove brightcove-playlist', autoplay: 'muted' }
8238
+ }),
8239
+ React__default.createElement(
8240
+ 'style',
8241
+ { jsx: 'true' },
8242
+ '\n .brightcove {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n width: 100%;\n }\n .brightcove .video-js {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n '
8243
+ )
8244
+ );
8218
8245
  } else if (experienceID) {
8219
8246
  return React__default.createElement(
8220
8247
  'div',
@@ -13041,6 +13068,27 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
13041
13068
  setState(nodes.videos[nextVid].url, '', nextVid + 1);
13042
13069
  }
13043
13070
 
13071
+ var autoplayNextVideo = function autoplayNextVideo(e) {
13072
+ //for brightcove videos
13073
+
13074
+ var currentVid = void 0;
13075
+ var nextVid = void 0;
13076
+ //Find index of video currently playing
13077
+ seriesData.forEach(function (vid, index) {
13078
+ if (vid.url === vidUrl) {
13079
+ currentVid = index;
13080
+ }
13081
+ });
13082
+ //increment +1, or if at the end of the series list, go back to the beginning
13083
+ if (currentVid + 1 >= seriesData.length) {
13084
+ nextVid = 0;
13085
+ } else {
13086
+ nextVid = currentVid + 1;
13087
+ }
13088
+ // set the new Video URL
13089
+ setState(nodes.videos[nextVid].url, '', nextVid + 1);
13090
+ };
13091
+
13044
13092
  var handlePlayPercent = function handlePlayPercent(player) {
13045
13093
  var current = player.getCurrentTime();
13046
13094
  var duration = player.getDuration();
@@ -13107,7 +13155,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
13107
13155
  }
13108
13156
  }),
13109
13157
  vidUrl && vidType == 'mp4' && React__default.createElement(VideoMp4, { url: vidUrl, thumbnail: vidThumbnail, vidLoaded: vidLoaded }),
13110
- vidUrl && vidType == 'brightcove' && React__default.createElement(Video, { node: { videoID: vidUrl, source: 'brightcove' }, accountIDs: accountIDs }),
13158
+ vidUrl && vidType == 'brightcove' && React__default.createElement(Video, { autoplay: true, node: { videoID: vidUrl, source: 'brightcove' }, accountIDs: accountIDs, autoplayNextVideo: autoplayNextVideo }),
13111
13159
  React__default.createElement(
13112
13160
  'div',
13113
13161
  {
@@ -13159,7 +13207,7 @@ var YouTubeGallery = function YouTubeGallery(_ref) {
13159
13207
  React__default.createElement(
13160
13208
  'style',
13161
13209
  { jsx: 'true' },
13162
- '\n \n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n .brightcove .video-js {\n float: none;\n width: 100%;\n height: 385px;\n }\n @media screen and (max-width: 1399px) {\n .brightcove .video-js {\n height: 360px;\n }\n }\n @media screen and (max-width: 495px) {\n .brightcove .video-js {\n height: 255px;\n }\n }\n '
13210
+ '\n \n #fluid-video-container > div {\n position: relative;\n padding-bottom: 56.25%; /* 16:9 */\n height: 0;\n }\n #fluid-video-container .fluid-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100% !important;\n }\n\n span.btn {\n margin: 0 1rem;\n }\n \n \n '
13163
13211
  )
13164
13212
  );
13165
13213
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.430",
3
+ "version": "1.0.431",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",