pds-dev-kit-web-test 2.5.356 → 2.5.358

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.
@@ -48,6 +48,7 @@ var util_1 = require("../util");
48
48
  function CustomSectionBackgroundMedia(_a) {
49
49
  var specs = _a.specs, playerId = _a.playerId, mediaType = _a.mediaType, componentStyle = _a.componentStyle, device = _a.device, backgroundRef = _a.backgroundRef;
50
50
  var _b = (0, util_1.parseSectionBackgroundMediaData)(specs, device), CB_STYLE_PROP_BGMEDIA_SPEC_YSRC = _b.CB_STYLE_PROP_BGMEDIA_SPEC_YSRC, CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY = _b.CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY, CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME, CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME = _b.CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME, CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR = _b.CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR, CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR = _b.CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR;
51
+ console.log(specs);
51
52
  var _c = (0, react_1.useState)({ width: 0, height: 0 }), youtubeSize = _c[0], setYoutubeSize = _c[1];
52
53
  var youTubeIframeKey = (0, react_1.useMemo)(function () {
53
54
  return "".concat(utils_1.YouTubeLinkParser.getId(String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC)), "-").concat(CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY, "-").concat(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME, "-").concat(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME);
@@ -99,6 +100,7 @@ function CustomSectionBackgroundMedia(_a) {
99
100
  if ('background' in componentStyle) {
100
101
  delete componentStyle.background;
101
102
  }
103
+ console.log('media type', mediaType);
102
104
  switch (mediaType) {
103
105
  case 'IMAGE':
104
106
  return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR && ((0, jsx_runtime_1.jsx)(S_Image, __assign({ src: String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR), normalStyle: componentStyle }, { children: (0, jsx_runtime_1.jsx)("img", { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR), style: { visibility: 'hidden', width: '100%', height: '100%' } }) }))) }));
@@ -106,7 +108,7 @@ function CustomSectionBackgroundMedia(_a) {
106
108
  return ((0, jsx_runtime_1.jsx)(S_YoutubeContainer, __assign({}, youtubeSize, { children: youtubeSize.height > 0 && youtubeSize.width > 0 && ((0, jsx_runtime_1.jsx)(YouTubeIframe_1.YouTubeIframe, { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_YSRC), id: playerId, loopMode: CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY ? 'use' : 'none', startSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_STARTTIME), endSeconds: Number(CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME), customHeight: youtubeSize.height, customWidth: youtubeSize.width }, youTubeIframeKey)) })));
107
109
  case 'NONE':
108
110
  case 'VIDEO':
109
- return ((0, jsx_runtime_1.jsx)(S_Video, __assign({ autoPlay: true, loop: true, muted: true, playsInline: true }, { children: (0, jsx_runtime_1.jsx)("source", { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR), type: "video/mp4" }) })));
111
+ return ((0, jsx_runtime_1.jsx)(S_Video, __assign({ autoPlay: true, loop: true, muted: true, playsInline: true }, { children: (0, jsx_runtime_1.jsx)("source", { src: String(CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR), type: "video/mp4" }) }), String(CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR)));
110
112
  default:
111
113
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {});
112
114
  }
@@ -25,7 +25,8 @@ var AVAILABLE_SPECS = [
25
25
  'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEPOSITION',
26
26
  'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR',
27
27
  'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGEFIT',
28
- 'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME'
28
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_ENDTIME',
29
+ 'CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR'
29
30
  ];
30
31
  function UseCustomSectionBackgroundMediaData(specs, device) {
31
32
  return AVAILABLE_SPECS.reduce(function (acc, cur) {
@@ -281,6 +281,7 @@ export declare const MOCK_SECTIONS: {
281
281
  'CB_STYLE_PROP_BGCOLOR_SPEC_TYPE:MOBILE:HOVER': null;
282
282
  };
283
283
  CB_STYLE_PROP_BGMEDIA: {
284
+ CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR: string;
284
285
  'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR:MOBILE:HOVER': null;
285
286
  CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY: boolean;
286
287
  'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY:MOBILE': null;
@@ -4355,6 +4355,7 @@ exports.MOCK_SECTIONS = [
4355
4355
  'CB_STYLE_PROP_BGCOLOR_SPEC_TYPE:MOBILE:HOVER': null
4356
4356
  },
4357
4357
  CB_STYLE_PROP_BGMEDIA: {
4358
+ CB_STYLE_PROP_BGMEDIA_SPEC_VIDEOSELECTOR: 'https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4',
4358
4359
  'CB_STYLE_PROP_BGMEDIA_SPEC_IMAGESELECTOR:MOBILE:HOVER': null,
4359
4360
  CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY: true,
4360
4361
  'CB_STYLE_PROP_BGMEDIA_SPEC_REPLAY:MOBILE': null,
@@ -116,7 +116,7 @@ function VideoPlayer(props) {
116
116
  observer.disconnect();
117
117
  };
118
118
  }, []);
119
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsxs)(S_Video, __assign({ ref: videoRef, controls: true, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, preload: "auto", loop: true, muted: true }, { children: [(0, jsx_runtime_1.jsx)("source", { src: getVideoSrc() + getTimeHash(), type: "video/mp4" }), "Your browser does not support the video tag."] }))] }));
119
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsxs)(S_Video, __assign({ ref: videoRef, controls: true, poster: CB_CONTENT_PROP_VIDEO_SPEC_THUMB, preload: "auto", loop: true, muted: true }, { children: [(0, jsx_runtime_1.jsx)("source", { src: getVideoSrc() + getTimeHash(), type: "video/mp4" }), "Your browser does not support the video tag."] }), CB_CONTENT_PROP_VIDEO_SPEC_SELECTOR)] }));
120
120
  }
121
121
  var S_Video = styled_components_1.default.video(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n height: 100%;\n object-fit: cover;\n width: 100%;\n"], ["\n height: 100%;\n object-fit: cover;\n width: 100%;\n"])));
122
122
  exports.default = VideoPlayer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pds-dev-kit-web-test",
3
- "version": "2.5.356",
3
+ "version": "2.5.358",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "main": "dist/index.js",