@micromag/screen-video-360 0.2.287 → 0.2.288

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/es/index.js CHANGED
@@ -16,6 +16,7 @@ import Background from '@micromag/element-background';
16
16
  import Container from '@micromag/element-container';
17
17
  import ClosedCaptions from '@micromag/element-closed-captions';
18
18
  import MediaControls from '@micromag/element-media-controls';
19
+ import Image from '@micromag/element-image';
19
20
  import Video from '@micromag/element-video';
20
21
  import CallToAction from '@micromag/element-call-to-action';
21
22
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -422,7 +423,7 @@ var Video360Screen = function Video360Screen(_ref) {
422
423
  transitions: transitions,
423
424
  disabled: transitionDisabled,
424
425
  fullscreen: true
425
- }, /*#__PURE__*/React.createElement("canvas", {
426
+ }, withVideoSphere ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("canvas", {
426
427
  ref: canvasRef,
427
428
  className: styles.canvas
428
429
  }), /*#__PURE__*/React.createElement("button", {
@@ -432,7 +433,26 @@ var Video360Screen = function Video360Screen(_ref) {
432
433
  onPointerDown: onPointerDown,
433
434
  onPointerMove: onPointerMove,
434
435
  onPointerUp: onPointerUp
435
- }))), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
436
+ })) : /*#__PURE__*/React.createElement("div", {
437
+ className: styles.videoContainer,
438
+ style: {
439
+ width: resizedVideoWidth,
440
+ height: resizedVideoHeight,
441
+ left: resizedVideoLeft,
442
+ top: resizedVideoTop
443
+ }
444
+ }, /*#__PURE__*/React.createElement(Image, {
445
+ className: styles.video,
446
+ media: {
447
+ url: thumbnailUrl,
448
+ metadata: {
449
+ width: videoWidth,
450
+ height: videoHeight
451
+ }
452
+ },
453
+ width: "100%",
454
+ height: "100%"
455
+ })))), !isPlaceholder ? /*#__PURE__*/React.createElement("div", {
436
456
  key: "bottom-content",
437
457
  className: styles.bottomContent
438
458
  }, /*#__PURE__*/React.createElement(Transitions, {
@@ -464,8 +484,7 @@ var Video360Screen = function Video360Screen(_ref) {
464
484
  })) : null)) : null];
465
485
  return /*#__PURE__*/React.createElement("div", {
466
486
  className: classNames([styles.container, (_ref12 = {}, _defineProperty(_ref12, className, className !== null), _defineProperty(_ref12, styles.showVideo, isPreview || isStatic || isCapture), _ref12)]),
467
- "data-screen-ready": (isStatic || isCapture) && posterReady || ready // {...longPressBind}
468
-
487
+ "data-screen-ready": (isStatic || isCapture) && posterReady || ready
469
488
  }, !isPlaceholder ? /*#__PURE__*/React.createElement(Background, Object.assign({}, background, {
470
489
  width: width,
471
490
  height: height,
@@ -486,7 +505,7 @@ var Video360Screen = function Video360Screen(_ref) {
486
505
  ref: apiRef,
487
506
  className: styles.video,
488
507
  withoutCors: true,
489
- preload: "auto",
508
+ preload: "metadata",
490
509
  onReady: onVideoReady,
491
510
  onPlay: onPlay,
492
511
  onPause: onPause,
package/lib/index.js CHANGED
@@ -20,6 +20,7 @@ var Background = require('@micromag/element-background');
20
20
  var Container = require('@micromag/element-container');
21
21
  var ClosedCaptions = require('@micromag/element-closed-captions');
22
22
  var MediaControls = require('@micromag/element-media-controls');
23
+ var Image = require('@micromag/element-image');
23
24
  var Video = require('@micromag/element-video');
24
25
  var CallToAction = require('@micromag/element-call-to-action');
25
26
  var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
@@ -37,6 +38,7 @@ var Background__default = /*#__PURE__*/_interopDefaultLegacy(Background);
37
38
  var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
38
39
  var ClosedCaptions__default = /*#__PURE__*/_interopDefaultLegacy(ClosedCaptions);
39
40
  var MediaControls__default = /*#__PURE__*/_interopDefaultLegacy(MediaControls);
41
+ var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image);
40
42
  var Video__default = /*#__PURE__*/_interopDefaultLegacy(Video);
41
43
  var CallToAction__default = /*#__PURE__*/_interopDefaultLegacy(CallToAction);
42
44
  var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
@@ -442,7 +444,7 @@ var Video360Screen = function Video360Screen(_ref) {
442
444
  transitions: transitions,
443
445
  disabled: transitionDisabled,
444
446
  fullscreen: true
445
- }, /*#__PURE__*/React__default['default'].createElement("canvas", {
447
+ }, withVideoSphere ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("canvas", {
446
448
  ref: canvasRef,
447
449
  className: styles.canvas
448
450
  }), /*#__PURE__*/React__default['default'].createElement("button", {
@@ -452,7 +454,26 @@ var Video360Screen = function Video360Screen(_ref) {
452
454
  onPointerDown: onPointerDown,
453
455
  onPointerMove: onPointerMove,
454
456
  onPointerUp: onPointerUp
455
- }))), !isPlaceholder ? /*#__PURE__*/React__default['default'].createElement("div", {
457
+ })) : /*#__PURE__*/React__default['default'].createElement("div", {
458
+ className: styles.videoContainer,
459
+ style: {
460
+ width: resizedVideoWidth,
461
+ height: resizedVideoHeight,
462
+ left: resizedVideoLeft,
463
+ top: resizedVideoTop
464
+ }
465
+ }, /*#__PURE__*/React__default['default'].createElement(Image__default['default'], {
466
+ className: styles.video,
467
+ media: {
468
+ url: thumbnailUrl,
469
+ metadata: {
470
+ width: videoWidth,
471
+ height: videoHeight
472
+ }
473
+ },
474
+ width: "100%",
475
+ height: "100%"
476
+ })))), !isPlaceholder ? /*#__PURE__*/React__default['default'].createElement("div", {
456
477
  key: "bottom-content",
457
478
  className: styles.bottomContent
458
479
  }, /*#__PURE__*/React__default['default'].createElement(components.Transitions, {
@@ -484,8 +505,7 @@ var Video360Screen = function Video360Screen(_ref) {
484
505
  })) : null)) : null];
485
506
  return /*#__PURE__*/React__default['default'].createElement("div", {
486
507
  className: classNames__default['default']([styles.container, (_ref12 = {}, _defineProperty__default['default'](_ref12, className, className !== null), _defineProperty__default['default'](_ref12, styles.showVideo, isPreview || isStatic || isCapture), _ref12)]),
487
- "data-screen-ready": (isStatic || isCapture) && posterReady || ready // {...longPressBind}
488
-
508
+ "data-screen-ready": (isStatic || isCapture) && posterReady || ready
489
509
  }, !isPlaceholder ? /*#__PURE__*/React__default['default'].createElement(Background__default['default'], Object.assign({}, background, {
490
510
  width: width,
491
511
  height: height,
@@ -506,7 +526,7 @@ var Video360Screen = function Video360Screen(_ref) {
506
526
  ref: apiRef,
507
527
  className: styles.video,
508
528
  withoutCors: true,
509
- preload: "auto",
529
+ preload: "metadata",
510
530
  onReady: onVideoReady,
511
531
  onPlay: onPlay,
512
532
  onPause: onPause,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-video-360",
3
- "version": "0.2.287",
3
+ "version": "0.2.288",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -55,6 +55,7 @@
55
55
  "@micromag/element-call-to-action": "^0.2.287",
56
56
  "@micromag/element-closed-captions": "^0.2.287",
57
57
  "@micromag/element-container": "^0.2.287",
58
+ "@micromag/element-image": "^0.2.287",
58
59
  "@micromag/element-media-controls": "^0.2.287",
59
60
  "@micromag/element-video": "^0.2.287",
60
61
  "@micromag/transforms": "^0.2.287",
@@ -69,5 +70,5 @@
69
70
  "publishConfig": {
70
71
  "access": "public"
71
72
  },
72
- "gitHead": "cd683d40baf88a5d02714cd9cdc7a45575bd2401"
73
+ "gitHead": "848be36486daa264d9ffe989cde957b66fa51d12"
73
74
  }