@mjhls/mjh-framework 1.0.377 → 1.0.379

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,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.377
2
+ # mjh-framework v. 1.0.379
3
3
 
4
4
 
5
5
  > Foundation Framework
package/dist/cjs/index.js CHANGED
@@ -8910,7 +8910,9 @@ function (_React$Component) {
8910
8910
 
8911
8911
  var Video = function Video(_ref) {
8912
8912
  var node = _ref.node,
8913
- accountIDs = _ref.accountIDs;
8913
+ accountIDs = _ref.accountIDs,
8914
+ _ref$autoplay = _ref.autoplay,
8915
+ autoplay = _ref$autoplay === undefined ? false : _ref$autoplay;
8914
8916
  var source = node.source,
8915
8917
  videoID = node.videoID,
8916
8918
  playlistID = node.playlistID,
@@ -8930,7 +8932,20 @@ var Video = function Video(_ref) {
8930
8932
  var queue = Math.floor(duration / 10);
8931
8933
  var segment = Math.floor(current / queue);
8932
8934
 
8933
- AdSlot.Beam.report_beam_video('Ready', main.main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8935
+ // try to auto play first with no-mute
8936
+ if (autoplay) {
8937
+ player.play().then(function () {
8938
+ player.muted(false);
8939
+ }).catch(function (error) {
8940
+ // then try to auto play with mute
8941
+ player.muted(true);
8942
+ player.play();
8943
+ });
8944
+ } else {
8945
+ player.pause();
8946
+ }
8947
+
8948
+ AdSlot.Beam.report_beam_video('Ready', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8934
8949
  });
8935
8950
 
8936
8951
  // play
@@ -8939,7 +8954,7 @@ var Video = function Video(_ref) {
8939
8954
  var current = player.currentTime();
8940
8955
  var queue = Math.floor(duration / 10);
8941
8956
  var segment = Math.floor(current / queue);
8942
- AdSlot.Beam.report_beam_video('Play', main.main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8957
+ AdSlot.Beam.report_beam_video('Play', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8943
8958
  });
8944
8959
 
8945
8960
  // pause
@@ -8948,7 +8963,7 @@ var Video = function Video(_ref) {
8948
8963
  var current = player.currentTime();
8949
8964
  var queue = Math.floor(duration / 10);
8950
8965
  var segment = Math.floor(current / queue);
8951
- AdSlot.Beam.report_beam_video('Pause', main.main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8966
+ AdSlot.Beam.report_beam_video('Pause', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8952
8967
  });
8953
8968
 
8954
8969
  // end
@@ -8957,7 +8972,7 @@ var Video = function Video(_ref) {
8957
8972
  var current = player.currentTime();
8958
8973
  var queue = Math.floor(duration / 10);
8959
8974
  var segment = Math.floor(current / queue);
8960
- AdSlot.Beam.report_beam_video('End', main.main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8975
+ AdSlot.Beam.report_beam_video('End', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8961
8976
  });
8962
8977
 
8963
8978
  var queueProgress = [];
@@ -8967,7 +8982,7 @@ var Video = function Video(_ref) {
8967
8982
  var queue = Math.floor(duration / 10);
8968
8983
  var segment = Math.floor(current / queue);
8969
8984
  if (!queueProgress.includes(segment)) {
8970
- AdSlot.Beam.report_beam_video('Segment', main.main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8985
+ AdSlot.Beam.report_beam_video('Segment', main.main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8971
8986
  queueProgress.push(segment);
8972
8987
  }
8973
8988
  });
@@ -8992,14 +9007,14 @@ var Video = function Video(_ref) {
8992
9007
 
8993
9008
  if (source === 'brightcove' && accountIDs.brightcove) {
8994
9009
  if (videoID) {
8995
- return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
9010
+ return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove', autoplay: 'muted' } });
8996
9011
  } else if (playlistID) {
8997
9012
  return React__default.createElement(ReactPlayerLoader, {
8998
9013
  accountId: accountIDs.brightcove.accountId,
8999
9014
  playlistId: playlistID,
9000
9015
  playerId: accountIDs.brightcove.playerId,
9001
9016
  onSuccess: onVideoSuccess,
9002
- attrs: { className: 'brightcove brightcove-playlist' }
9017
+ attrs: { className: 'brightcove brightcove-playlist', autoplay: 'muted' }
9003
9018
  });
9004
9019
  } else if (experienceID) {
9005
9020
  return React__default.createElement(
@@ -14422,7 +14437,9 @@ var getSerializers = function getSerializers() {
14422
14437
  onVote = props[3],
14423
14438
  showVotes = props[4],
14424
14439
  drupalLeadSettings = props[5],
14425
- currentPage = props[6];
14440
+ currentPage = props[6],
14441
+ _props$ = props[7],
14442
+ autoplay = _props$ === undefined ? false : _props$;
14426
14443
 
14427
14444
  return {
14428
14445
  types: {
@@ -14478,7 +14495,7 @@ var getSerializers = function getSerializers() {
14478
14495
  video: function video(_ref9) {
14479
14496
  var node = _ref9.node;
14480
14497
 
14481
- return React__default.createElement(Video, { node: node, accountIDs: videoAccountIDs || {} });
14498
+ return React__default.createElement(Video, { node: node, autoplay: autoplay, accountIDs: videoAccountIDs || {} });
14482
14499
  },
14483
14500
  audio: function audio(_ref10) {
14484
14501
  var node = _ref10.node;
@@ -17185,7 +17202,7 @@ var Article = function Article(props) {
17185
17202
  React__default.Fragment,
17186
17203
  null,
17187
17204
  React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
17188
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
17205
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
17189
17206
  blocks: [].concat(toConsumableArray._toConsumableArray(body.slice(0, selectedIndex))),
17190
17207
  imageOptions: { w: 320, h: 240, fit: 'max' }
17191
17208
  }, client.config())),
@@ -17195,14 +17212,14 @@ var Article = function Article(props) {
17195
17212
  React__default.createElement(AdSlot.DFPAdSlot, _extends$2._extends({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: checkIsAdFound }))
17196
17213
  ),
17197
17214
  React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
17198
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
17215
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
17199
17216
  blocks: [].concat(toConsumableArray._toConsumableArray(body.slice(selectedIndex))),
17200
17217
  imageOptions: { w: 320, h: 240, fit: 'max' }
17201
17218
  }, client.config()))
17202
17219
  );
17203
17220
  } else {
17204
17221
  return React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
17205
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings),
17222
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
17206
17223
  blocks: articleBody,
17207
17224
  imageOptions: { w: 320, h: 240, fit: 'max' }
17208
17225
  }, client.config()));
package/dist/esm/index.js CHANGED
@@ -8907,7 +8907,9 @@ function (_React$Component) {
8907
8907
 
8908
8908
  var Video = function Video(_ref) {
8909
8909
  var node = _ref.node,
8910
- accountIDs = _ref.accountIDs;
8910
+ accountIDs = _ref.accountIDs,
8911
+ _ref$autoplay = _ref.autoplay,
8912
+ autoplay = _ref$autoplay === undefined ? false : _ref$autoplay;
8911
8913
  var source = node.source,
8912
8914
  videoID = node.videoID,
8913
8915
  playlistID = node.playlistID,
@@ -8927,7 +8929,20 @@ var Video = function Video(_ref) {
8927
8929
  var queue = Math.floor(duration / 10);
8928
8930
  var segment = Math.floor(current / queue);
8929
8931
 
8930
- Beam.report_beam_video('Ready', main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8932
+ // try to auto play first with no-mute
8933
+ if (autoplay) {
8934
+ player.play().then(function () {
8935
+ player.muted(false);
8936
+ }).catch(function (error) {
8937
+ // then try to auto play with mute
8938
+ player.muted(true);
8939
+ player.play();
8940
+ });
8941
+ } else {
8942
+ player.pause();
8943
+ }
8944
+
8945
+ Beam.report_beam_video('Ready', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8931
8946
  });
8932
8947
 
8933
8948
  // play
@@ -8936,7 +8951,7 @@ var Video = function Video(_ref) {
8936
8951
  var current = player.currentTime();
8937
8952
  var queue = Math.floor(duration / 10);
8938
8953
  var segment = Math.floor(current / queue);
8939
- Beam.report_beam_video('Play', main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8954
+ Beam.report_beam_video('Play', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8940
8955
  });
8941
8956
 
8942
8957
  // pause
@@ -8945,7 +8960,7 @@ var Video = function Video(_ref) {
8945
8960
  var current = player.currentTime();
8946
8961
  var queue = Math.floor(duration / 10);
8947
8962
  var segment = Math.floor(current / queue);
8948
- Beam.report_beam_video('Pause', main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8963
+ Beam.report_beam_video('Pause', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8949
8964
  });
8950
8965
 
8951
8966
  // end
@@ -8954,7 +8969,7 @@ var Video = function Video(_ref) {
8954
8969
  var current = player.currentTime();
8955
8970
  var queue = Math.floor(duration / 10);
8956
8971
  var segment = Math.floor(current / queue);
8957
- Beam.report_beam_video('End', main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8972
+ Beam.report_beam_video('End', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8958
8973
  });
8959
8974
 
8960
8975
  var queueProgress = [];
@@ -8964,7 +8979,7 @@ var Video = function Video(_ref) {
8964
8979
  var queue = Math.floor(duration / 10);
8965
8980
  var segment = Math.floor(current / queue);
8966
8981
  if (!queueProgress.includes(segment)) {
8967
- Beam.report_beam_video('Segment', main_16, duration, current, segment, 'BrightCove', chapter.playerID, chapter.accountID, chapter.mediaID);
8982
+ Beam.report_beam_video('Segment', main_16, duration, current, segment, 'BrightCove', accountIDs.brightcove.playerId, accountIDs.brightcove.accountId, videoID);
8968
8983
  queueProgress.push(segment);
8969
8984
  }
8970
8985
  });
@@ -8989,14 +9004,14 @@ var Video = function Video(_ref) {
8989
9004
 
8990
9005
  if (source === 'brightcove' && accountIDs.brightcove) {
8991
9006
  if (videoID) {
8992
- return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove' } });
9007
+ return React__default.createElement(ReactPlayerLoader, { onSuccess: onVideoSuccess, accountId: accountIDs.brightcove.accountId, videoId: videoID, playerId: accountIDs.brightcove.playerId, attrs: { className: 'brightcove', autoplay: 'muted' } });
8993
9008
  } else if (playlistID) {
8994
9009
  return React__default.createElement(ReactPlayerLoader, {
8995
9010
  accountId: accountIDs.brightcove.accountId,
8996
9011
  playlistId: playlistID,
8997
9012
  playerId: accountIDs.brightcove.playerId,
8998
9013
  onSuccess: onVideoSuccess,
8999
- attrs: { className: 'brightcove brightcove-playlist' }
9014
+ attrs: { className: 'brightcove brightcove-playlist', autoplay: 'muted' }
9000
9015
  });
9001
9016
  } else if (experienceID) {
9002
9017
  return React__default.createElement(
@@ -14419,7 +14434,9 @@ var getSerializers = function getSerializers() {
14419
14434
  onVote = props[3],
14420
14435
  showVotes = props[4],
14421
14436
  drupalLeadSettings = props[5],
14422
- currentPage = props[6];
14437
+ currentPage = props[6],
14438
+ _props$ = props[7],
14439
+ autoplay = _props$ === undefined ? false : _props$;
14423
14440
 
14424
14441
  return {
14425
14442
  types: {
@@ -14475,7 +14492,7 @@ var getSerializers = function getSerializers() {
14475
14492
  video: function video(_ref9) {
14476
14493
  var node = _ref9.node;
14477
14494
 
14478
- return React__default.createElement(Video, { node: node, accountIDs: videoAccountIDs || {} });
14495
+ return React__default.createElement(Video, { node: node, autoplay: autoplay, accountIDs: videoAccountIDs || {} });
14479
14496
  },
14480
14497
  audio: function audio(_ref10) {
14481
14498
  var node = _ref10.node;
@@ -17182,7 +17199,7 @@ var Article = function Article(props) {
17182
17199
  React__default.Fragment,
17183
17200
  null,
17184
17201
  React__default.createElement(BlockContent, _extends$2({
17185
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
17202
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
17186
17203
  blocks: [].concat(_toConsumableArray(body.slice(0, selectedIndex))),
17187
17204
  imageOptions: { w: 320, h: 240, fit: 'max' }
17188
17205
  }, client.config())),
@@ -17192,14 +17209,14 @@ var Article = function Article(props) {
17192
17209
  React__default.createElement(DFPAdSlot, _extends$2({}, payload.contextualAD, { refreshFlag: false, checkIsAdFound: checkIsAdFound }))
17193
17210
  ),
17194
17211
  React__default.createElement(BlockContent, _extends$2({
17195
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage),
17212
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
17196
17213
  blocks: [].concat(_toConsumableArray(body.slice(selectedIndex))),
17197
17214
  imageOptions: { w: 320, h: 240, fit: 'max' }
17198
17215
  }, client.config()))
17199
17216
  );
17200
17217
  } else {
17201
17218
  return React__default.createElement(BlockContent, _extends$2({
17202
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings),
17219
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true, drupalLeadSettings, currentPage, false),
17203
17220
  blocks: articleBody,
17204
17221
  imageOptions: { w: 320, h: 240, fit: 'max' }
17205
17222
  }, client.config()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.377",
3
+ "version": "1.0.379",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",