@fonixtree/magic-design 1.0.187 → 1.0.188

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.
@@ -91,9 +91,17 @@ function (_super) {
91
91
  var _this = _super !== null && _super.apply(this, arguments) || this;
92
92
 
93
93
  _this.state = {};
94
+ _this.videoRef = /*#__PURE__*/_react["default"].createRef();
94
95
  return _this;
95
96
  }
96
97
 
98
+ ProductItem.prototype.componentDidMount = function () {
99
+ if (this.videoRef.current) {
100
+ this.videoRef.current.setAttribute('playsinline', '');
101
+ this.videoRef.current.setAttribute('webkit-playsinline', '');
102
+ }
103
+ };
104
+
97
105
  ProductItem.prototype.render = function () {
98
106
  var _a, _b, _c, _d, _e, _f, _g;
99
107
 
@@ -165,29 +173,16 @@ function (_super) {
165
173
  }, data.url && !data.url.includes('.mp4') && /*#__PURE__*/_react["default"].createElement("img", {
166
174
  alt: "welcome advertise",
167
175
  src: data.url
168
- }), data.url && data.url.includes('.mp4') &&
169
- /*#__PURE__*/
170
- // <video
171
- // autoPlay
172
- // loop
173
- // muted
174
- // playsinline
175
- // webkit-playsinline
176
- // >
177
- // <source src={data.url} type="video/mp4" />
178
- // </video>
179
- _react["default"].createElement("div", {
180
- className: "video-wrap"
181
- }, /*#__PURE__*/_react["default"].createElement(_common.Video, {
182
- key: data.id + "-" + data.url + "}",
183
- opts: {
184
- source: data.url,
185
- controlBarHide: true,
186
- autoplay: true,
187
- loop: true,
188
- speed: 1
189
- },
190
- videoId: data.id
176
+ }), data.url && data.url.includes('.mp4') && /*#__PURE__*/_react["default"].createElement("video", {
177
+ ref: this.videoRef,
178
+ autoPlay: true,
179
+ loop: true,
180
+ muted: true,
181
+ playsinline: true,
182
+ "webkit-playsinline": true
183
+ }, /*#__PURE__*/_react["default"].createElement("source", {
184
+ src: data.url,
185
+ type: "video/mp4"
191
186
  })));
192
187
  }
193
188
 
@@ -91,9 +91,17 @@ function (_super) {
91
91
  var _this = _super !== null && _super.apply(this, arguments) || this;
92
92
 
93
93
  _this.state = {};
94
+ _this.videoRef = /*#__PURE__*/_react["default"].createRef();
94
95
  return _this;
95
96
  }
96
97
 
98
+ ProductItem.prototype.componentDidMount = function () {
99
+ if (this.videoRef.current) {
100
+ this.videoRef.current.setAttribute('playsinline', '');
101
+ this.videoRef.current.setAttribute('webkit-playsinline', '');
102
+ }
103
+ };
104
+
97
105
  ProductItem.prototype.render = function () {
98
106
  var _a, _b, _c, _d, _e, _f, _g;
99
107
 
@@ -165,29 +173,16 @@ function (_super) {
165
173
  }, data.url && !data.url.includes('.mp4') && /*#__PURE__*/_react["default"].createElement("img", {
166
174
  alt: "welcome advertise",
167
175
  src: data.url
168
- }), data.url && data.url.includes('.mp4') &&
169
- /*#__PURE__*/
170
- // <video
171
- // autoPlay
172
- // loop
173
- // muted
174
- // playsinline
175
- // webkit-playsinline
176
- // >
177
- // <source src={data.url} type="video/mp4" />
178
- // </video>
179
- _react["default"].createElement("div", {
180
- className: "video-wrap"
181
- }, /*#__PURE__*/_react["default"].createElement(_common.Video, {
182
- key: data.id + "-" + data.url + "}",
183
- opts: {
184
- source: data.url,
185
- controlBarHide: true,
186
- autoplay: true,
187
- loop: true,
188
- speed: 1
189
- },
190
- videoId: data.id
176
+ }), data.url && data.url.includes('.mp4') && /*#__PURE__*/_react["default"].createElement("video", {
177
+ ref: this.videoRef,
178
+ autoPlay: true,
179
+ loop: true,
180
+ muted: true,
181
+ playsinline: true,
182
+ "webkit-playsinline": true
183
+ }, /*#__PURE__*/_react["default"].createElement("source", {
184
+ src: data.url,
185
+ type: "video/mp4"
191
186
  })));
192
187
  }
193
188
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.187",
4
+ "version": "1.0.188",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",