@blerp/design 1.2.11 → 1.2.12
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/dist/index.cjs.js +209 -221
- package/dist/index.esm.js +209 -221
- package/dist/index.umd.js +209 -221
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1515,215 +1515,6 @@
|
|
|
1515
1515
|
handleClickTitle: PropTypes__default['default'].func.isRequired
|
|
1516
1516
|
};
|
|
1517
1517
|
|
|
1518
|
-
var BlerpAudioContext = /*#__PURE__*/React.createContext({});
|
|
1519
|
-
var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
1520
|
-
var children = _ref.children;
|
|
1521
|
-
|
|
1522
|
-
if (typeof window === "undefined") {
|
|
1523
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, children);
|
|
1524
|
-
}
|
|
1525
|
-
|
|
1526
|
-
var _useState = React.useState(null),
|
|
1527
|
-
_useState2 = _slicedToArray__default['default'](_useState, 2),
|
|
1528
|
-
selectedBlerp = _useState2[0],
|
|
1529
|
-
_setSelectedBlerp = _useState2[1];
|
|
1530
|
-
|
|
1531
|
-
var _useState3 = React.useState("stopped"),
|
|
1532
|
-
_useState4 = _slicedToArray__default['default'](_useState3, 2),
|
|
1533
|
-
playState = _useState4[0],
|
|
1534
|
-
setPlayState = _useState4[1];
|
|
1535
|
-
|
|
1536
|
-
var _useState5 = React.useState(0),
|
|
1537
|
-
_useState6 = _slicedToArray__default['default'](_useState5, 2);
|
|
1538
|
-
_useState6[0];
|
|
1539
|
-
var setStartTime = _useState6[1]; // const [audioCtx, setAudioCtx] = useState(null);
|
|
1540
|
-
// Refs
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
var audioRef = React.useRef(new Audio());
|
|
1544
|
-
|
|
1545
|
-
var pause = /*#__PURE__*/function () {
|
|
1546
|
-
var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
1547
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
1548
|
-
while (1) {
|
|
1549
|
-
switch (_context.prev = _context.next) {
|
|
1550
|
-
case 0:
|
|
1551
|
-
setPlayState("paused");
|
|
1552
|
-
_context.next = 3;
|
|
1553
|
-
return audioRef.current.pause();
|
|
1554
|
-
|
|
1555
|
-
case 3:
|
|
1556
|
-
case "end":
|
|
1557
|
-
return _context.stop();
|
|
1558
|
-
}
|
|
1559
|
-
}
|
|
1560
|
-
}, _callee);
|
|
1561
|
-
}));
|
|
1562
|
-
|
|
1563
|
-
return function pause() {
|
|
1564
|
-
return _ref2.apply(this, arguments);
|
|
1565
|
-
};
|
|
1566
|
-
}();
|
|
1567
|
-
|
|
1568
|
-
var play = /*#__PURE__*/function () {
|
|
1569
|
-
var _ref4 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
1570
|
-
var _bite$audio, _bite$audio$mp;
|
|
1571
|
-
|
|
1572
|
-
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, newGain, audioCtx, gainNode, source;
|
|
1573
|
-
|
|
1574
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
1575
|
-
while (1) {
|
|
1576
|
-
switch (_context3.prev = _context3.next) {
|
|
1577
|
-
case 0:
|
|
1578
|
-
bite = _ref3.bite, _ref3$gain = _ref3.gain, gain = _ref3$gain === void 0 ? 1 : _ref3$gain, _ref3$startTime = _ref3.startTime, startTime = _ref3$startTime === void 0 ? 0 : _ref3$startTime, _ref3$forcePlay = _ref3.forcePlay, forcePlay = _ref3$forcePlay === void 0 ? false : _ref3$forcePlay;
|
|
1579
|
-
console.log("astats", startTime, playState);
|
|
1580
|
-
startTime = audioRef.current.currentTime > 0 ? audioRef.current.currentTime : startTime;
|
|
1581
|
-
console.log("play", playState, startTime);
|
|
1582
|
-
|
|
1583
|
-
if (!((bite === null || bite === void 0 ? void 0 : bite._id) !== (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id) && playState === "playing")) {
|
|
1584
|
-
_context3.next = 8;
|
|
1585
|
-
break;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
_context3.next = 7;
|
|
1589
|
-
return audioRef.current.pause();
|
|
1590
|
-
|
|
1591
|
-
case 7:
|
|
1592
|
-
if (!forcePlay) {
|
|
1593
|
-
startTime = 0;
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
case 8:
|
|
1597
|
-
if (!(playState === "playing" && (bite === null || bite === void 0 ? void 0 : bite._id) === (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id))) {
|
|
1598
|
-
_context3.next = 11;
|
|
1599
|
-
break;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
pause();
|
|
1603
|
-
return _context3.abrupt("return");
|
|
1604
|
-
|
|
1605
|
-
case 11:
|
|
1606
|
-
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio = bite.audio) === null || _bite$audio === void 0 ? void 0 : (_bite$audio$mp = _bite$audio.mp3) === null || _bite$audio$mp === void 0 ? void 0 : _bite$audio$mp.url);
|
|
1607
|
-
audioRef.current.crossOrigin = "anonymous";
|
|
1608
|
-
console.log("current time", startTime);
|
|
1609
|
-
audioRef.current.currentTime = startTime;
|
|
1610
|
-
newGain = gain;
|
|
1611
|
-
audioRef.current.onended = /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
|
|
1612
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
1613
|
-
while (1) {
|
|
1614
|
-
switch (_context2.prev = _context2.next) {
|
|
1615
|
-
case 0:
|
|
1616
|
-
console.log("ended");
|
|
1617
|
-
setPlayState("played");
|
|
1618
|
-
_context2.next = 4;
|
|
1619
|
-
return audioRef.current.pause();
|
|
1620
|
-
|
|
1621
|
-
case 4:
|
|
1622
|
-
audioRef.current.currentTime = 0;
|
|
1623
|
-
|
|
1624
|
-
case 5:
|
|
1625
|
-
case "end":
|
|
1626
|
-
return _context2.stop();
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
}, _callee2);
|
|
1630
|
-
}));
|
|
1631
|
-
audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
1632
|
-
gainNode = audioCtx.createGain(); // gainNode.gain.value = 2 // value between 0 and 2 https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API
|
|
1633
|
-
|
|
1634
|
-
gainNode.gain.setValueAtTime(newGain, 0);
|
|
1635
|
-
source = audioCtx.createMediaElementSource(audioRef.current);
|
|
1636
|
-
source.connect(gainNode);
|
|
1637
|
-
gainNode.connect(audioCtx.destination);
|
|
1638
|
-
_context3.next = 25;
|
|
1639
|
-
return audioRef.current.play().then(function () {
|
|
1640
|
-
console.log("playing", bite === null || bite === void 0 ? void 0 : bite.title);
|
|
1641
|
-
setPlayState("playing");
|
|
1642
|
-
}).catch(function (e) {
|
|
1643
|
-
setPlayState("stopped");
|
|
1644
|
-
});
|
|
1645
|
-
|
|
1646
|
-
case 25:
|
|
1647
|
-
// const playPromise = audioRef.current.play();
|
|
1648
|
-
// if (playPromise !== undefined) {
|
|
1649
|
-
// playPromise
|
|
1650
|
-
// .then((_) => {
|
|
1651
|
-
// // Automatic playback started!
|
|
1652
|
-
// // Show playing UI.
|
|
1653
|
-
// setPlayState("playing");
|
|
1654
|
-
// })
|
|
1655
|
-
// .catch((error) => {
|
|
1656
|
-
// // Auto-play was prevented
|
|
1657
|
-
// // Show paused UI.
|
|
1658
|
-
// console.log("playing failed witihin", error);
|
|
1659
|
-
// });
|
|
1660
|
-
// }
|
|
1661
|
-
_setSelectedBlerp(bite);
|
|
1662
|
-
|
|
1663
|
-
case 26:
|
|
1664
|
-
case "end":
|
|
1665
|
-
return _context3.stop();
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
}, _callee3);
|
|
1669
|
-
}));
|
|
1670
|
-
|
|
1671
|
-
return function play(_x) {
|
|
1672
|
-
return _ref4.apply(this, arguments);
|
|
1673
|
-
};
|
|
1674
|
-
}();
|
|
1675
|
-
|
|
1676
|
-
return /*#__PURE__*/React__default['default'].createElement(BlerpAudioContext.Provider, {
|
|
1677
|
-
value: {
|
|
1678
|
-
selectedBlerp: selectedBlerp,
|
|
1679
|
-
setSelectedBlerp: function setSelectedBlerp(_ref6) {
|
|
1680
|
-
var bite = _ref6.bite;
|
|
1681
|
-
|
|
1682
|
-
_setSelectedBlerp(bite);
|
|
1683
|
-
},
|
|
1684
|
-
pause: pause,
|
|
1685
|
-
play: play,
|
|
1686
|
-
stop: function () {
|
|
1687
|
-
var _stop = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
|
|
1688
|
-
var _audioRef$current;
|
|
1689
|
-
|
|
1690
|
-
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
1691
|
-
while (1) {
|
|
1692
|
-
switch (_context4.prev = _context4.next) {
|
|
1693
|
-
case 0:
|
|
1694
|
-
setPlayState("stopped");
|
|
1695
|
-
_context4.next = 3;
|
|
1696
|
-
return (_audioRef$current = audioRef.current) === null || _audioRef$current === void 0 ? void 0 : _audioRef$current.pause();
|
|
1697
|
-
|
|
1698
|
-
case 3:
|
|
1699
|
-
audioRef.current.currentTime = 0;
|
|
1700
|
-
|
|
1701
|
-
case 4:
|
|
1702
|
-
case "end":
|
|
1703
|
-
return _context4.stop();
|
|
1704
|
-
}
|
|
1705
|
-
}
|
|
1706
|
-
}, _callee4);
|
|
1707
|
-
}));
|
|
1708
|
-
|
|
1709
|
-
function stop() {
|
|
1710
|
-
return _stop.apply(this, arguments);
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
return stop;
|
|
1714
|
-
}(),
|
|
1715
|
-
getPlayState: function getPlayState(_ref7) {
|
|
1716
|
-
var biteId = _ref7.biteId;
|
|
1717
|
-
|
|
1718
|
-
if (biteId === (selectedBlerp && selectedBlerp._id)) {
|
|
1719
|
-
return playState;
|
|
1720
|
-
}
|
|
1721
|
-
},
|
|
1722
|
-
setStartTime: setStartTime
|
|
1723
|
-
}
|
|
1724
|
-
}, children);
|
|
1725
|
-
};
|
|
1726
|
-
|
|
1727
1518
|
var _templateObject$f, _templateObject2$a;
|
|
1728
1519
|
var PremiumContainer = styled__default['default'].div(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral__default['default'](["\n background: transparent;\n overflow: hidden;\n min-width: 210px;\n max-width: 260px;\n width: 100%;\n max-height: 322px;\n flex: 1;\n min-height: 272px;\n margin: 20px;\n aspect-ratio: 260 / 322;\n gap: 10px;\n border-radius: 18px;\n box-sizing: border-box;\n padding: 2px;\n position: relative;\n transition: 0.3s;\n"])));
|
|
1729
1520
|
var Container$1 = styled__default['default'].div(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral__default['default'](["\n background-color: ", ";\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n position: relative;\n height: 100%;\n padding: 10px;\n border-radius: 17px;\n box-sizing: border-box;\n"])), function (props) {
|
|
@@ -2133,13 +1924,9 @@
|
|
|
2133
1924
|
|
|
2134
1925
|
var _ref8$Waveform = _ref8.Waveform,
|
|
2135
1926
|
Waveform = _ref8$Waveform === void 0 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null) : _ref8$Waveform,
|
|
2136
|
-
bite = _ref8.bite
|
|
2137
|
-
_ref8.playState
|
|
2138
|
-
|
|
2139
|
-
var _useContext = React.useContext(BlerpAudioContext),
|
|
2140
|
-
play = _useContext.play,
|
|
2141
|
-
getPlayState = _useContext.getPlayState;
|
|
2142
|
-
_useContext.stop;
|
|
1927
|
+
bite = _ref8.bite,
|
|
1928
|
+
playState = _ref8.playState,
|
|
1929
|
+
play = _ref8.play;
|
|
2143
1930
|
|
|
2144
1931
|
var _useState9 = React.useState(false),
|
|
2145
1932
|
_useState10 = _slicedToArray__default['default'](_useState9, 2),
|
|
@@ -2157,10 +1944,6 @@
|
|
|
2157
1944
|
var saveCount = formatter.format(bite === null || bite === void 0 ? void 0 : bite.totalSaveCount);
|
|
2158
1945
|
|
|
2159
1946
|
var renderPlayStateIcon = function renderPlayStateIcon() {
|
|
2160
|
-
var playState = getPlayState({
|
|
2161
|
-
biteId: bite === null || bite === void 0 ? void 0 : bite._id
|
|
2162
|
-
});
|
|
2163
|
-
|
|
2164
1947
|
if (playState === "played") {
|
|
2165
1948
|
return /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
2166
1949
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2412,6 +2195,211 @@
|
|
|
2412
2195
|
}, ((bite === null || bite === void 0 ? void 0 : bite.audioDuration) / 1000).toFixed(0), "s"))));
|
|
2413
2196
|
};
|
|
2414
2197
|
|
|
2198
|
+
var BlerpAudioContext = /*#__PURE__*/React.createContext({});
|
|
2199
|
+
var BlerpAudioContextProvider$1 = function BlerpAudioContextProvider(_ref) {
|
|
2200
|
+
var children = _ref.children;
|
|
2201
|
+
|
|
2202
|
+
var _useState = React.useState(null),
|
|
2203
|
+
_useState2 = _slicedToArray__default['default'](_useState, 2),
|
|
2204
|
+
selectedBlerp = _useState2[0],
|
|
2205
|
+
_setSelectedBlerp = _useState2[1];
|
|
2206
|
+
|
|
2207
|
+
var _useState3 = React.useState("stopped"),
|
|
2208
|
+
_useState4 = _slicedToArray__default['default'](_useState3, 2),
|
|
2209
|
+
playState = _useState4[0],
|
|
2210
|
+
setPlayState = _useState4[1];
|
|
2211
|
+
|
|
2212
|
+
var _useState5 = React.useState(0),
|
|
2213
|
+
_useState6 = _slicedToArray__default['default'](_useState5, 2);
|
|
2214
|
+
_useState6[0];
|
|
2215
|
+
var setStartTime = _useState6[1]; // const [audioCtx, setAudioCtx] = useState(null);
|
|
2216
|
+
// Refs
|
|
2217
|
+
|
|
2218
|
+
|
|
2219
|
+
var audioRef = React.useRef(null);
|
|
2220
|
+
|
|
2221
|
+
var pause = /*#__PURE__*/function () {
|
|
2222
|
+
var _ref2 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee() {
|
|
2223
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee$(_context) {
|
|
2224
|
+
while (1) {
|
|
2225
|
+
switch (_context.prev = _context.next) {
|
|
2226
|
+
case 0:
|
|
2227
|
+
setPlayState("paused");
|
|
2228
|
+
_context.next = 3;
|
|
2229
|
+
return audioRef.current.pause();
|
|
2230
|
+
|
|
2231
|
+
case 3:
|
|
2232
|
+
case "end":
|
|
2233
|
+
return _context.stop();
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
}, _callee);
|
|
2237
|
+
}));
|
|
2238
|
+
|
|
2239
|
+
return function pause() {
|
|
2240
|
+
return _ref2.apply(this, arguments);
|
|
2241
|
+
};
|
|
2242
|
+
}();
|
|
2243
|
+
|
|
2244
|
+
var play = /*#__PURE__*/function () {
|
|
2245
|
+
var _ref4 = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee3(_ref3) {
|
|
2246
|
+
var _bite$audio, _bite$audio$mp;
|
|
2247
|
+
|
|
2248
|
+
var bite, _ref3$gain, gain, _ref3$startTime, startTime, _ref3$forcePlay, forcePlay, newGain, audioCtx, gainNode, source;
|
|
2249
|
+
|
|
2250
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee3$(_context3) {
|
|
2251
|
+
while (1) {
|
|
2252
|
+
switch (_context3.prev = _context3.next) {
|
|
2253
|
+
case 0:
|
|
2254
|
+
bite = _ref3.bite, _ref3$gain = _ref3.gain, gain = _ref3$gain === void 0 ? 1 : _ref3$gain, _ref3$startTime = _ref3.startTime, startTime = _ref3$startTime === void 0 ? 0 : _ref3$startTime, _ref3$forcePlay = _ref3.forcePlay, forcePlay = _ref3$forcePlay === void 0 ? false : _ref3$forcePlay;
|
|
2255
|
+
console.log("astats", startTime, playState);
|
|
2256
|
+
startTime = audioRef.current.currentTime > 0 ? audioRef.current.currentTime : startTime;
|
|
2257
|
+
console.log("play", playState, startTime);
|
|
2258
|
+
|
|
2259
|
+
if (!((bite === null || bite === void 0 ? void 0 : bite._id) !== (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id) && playState === "playing")) {
|
|
2260
|
+
_context3.next = 8;
|
|
2261
|
+
break;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
_context3.next = 7;
|
|
2265
|
+
return audioRef.current.pause();
|
|
2266
|
+
|
|
2267
|
+
case 7:
|
|
2268
|
+
if (!forcePlay) {
|
|
2269
|
+
startTime = 0;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
case 8:
|
|
2273
|
+
if (!(playState === "playing" && (bite === null || bite === void 0 ? void 0 : bite._id) === (selectedBlerp === null || selectedBlerp === void 0 ? void 0 : selectedBlerp._id))) {
|
|
2274
|
+
_context3.next = 11;
|
|
2275
|
+
break;
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
pause();
|
|
2279
|
+
return _context3.abrupt("return");
|
|
2280
|
+
|
|
2281
|
+
case 11:
|
|
2282
|
+
audioRef.current = new Audio(bite === null || bite === void 0 ? void 0 : (_bite$audio = bite.audio) === null || _bite$audio === void 0 ? void 0 : (_bite$audio$mp = _bite$audio.mp3) === null || _bite$audio$mp === void 0 ? void 0 : _bite$audio$mp.url);
|
|
2283
|
+
audioRef.current.crossOrigin = "anonymous";
|
|
2284
|
+
console.log("current time", startTime);
|
|
2285
|
+
audioRef.current.currentTime = startTime;
|
|
2286
|
+
newGain = gain;
|
|
2287
|
+
audioRef.current.onended = /*#__PURE__*/_asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee2() {
|
|
2288
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee2$(_context2) {
|
|
2289
|
+
while (1) {
|
|
2290
|
+
switch (_context2.prev = _context2.next) {
|
|
2291
|
+
case 0:
|
|
2292
|
+
console.log("ended");
|
|
2293
|
+
setPlayState("played");
|
|
2294
|
+
_context2.next = 4;
|
|
2295
|
+
return audioRef.current.pause();
|
|
2296
|
+
|
|
2297
|
+
case 4:
|
|
2298
|
+
audioRef.current.currentTime = 0;
|
|
2299
|
+
|
|
2300
|
+
case 5:
|
|
2301
|
+
case "end":
|
|
2302
|
+
return _context2.stop();
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}, _callee2);
|
|
2306
|
+
}));
|
|
2307
|
+
audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
2308
|
+
gainNode = audioCtx.createGain(); // gainNode.gain.value = 2 // value between 0 and 2 https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Using_Web_Audio_API
|
|
2309
|
+
|
|
2310
|
+
gainNode.gain.setValueAtTime(newGain, 0);
|
|
2311
|
+
source = audioCtx.createMediaElementSource(audioRef.current);
|
|
2312
|
+
source.connect(gainNode);
|
|
2313
|
+
gainNode.connect(audioCtx.destination);
|
|
2314
|
+
_context3.next = 25;
|
|
2315
|
+
return audioRef.current.play().then(function () {
|
|
2316
|
+
console.log("playing", bite === null || bite === void 0 ? void 0 : bite.title);
|
|
2317
|
+
setPlayState("playing");
|
|
2318
|
+
}).catch(function (e) {
|
|
2319
|
+
setPlayState("stopped");
|
|
2320
|
+
});
|
|
2321
|
+
|
|
2322
|
+
case 25:
|
|
2323
|
+
// const playPromise = audioRef.current.play();
|
|
2324
|
+
// if (playPromise !== undefined) {
|
|
2325
|
+
// playPromise
|
|
2326
|
+
// .then((_) => {
|
|
2327
|
+
// // Automatic playback started!
|
|
2328
|
+
// // Show playing UI.
|
|
2329
|
+
// setPlayState("playing");
|
|
2330
|
+
// })
|
|
2331
|
+
// .catch((error) => {
|
|
2332
|
+
// // Auto-play was prevented
|
|
2333
|
+
// // Show paused UI.
|
|
2334
|
+
// console.log("playing failed witihin", error);
|
|
2335
|
+
// });
|
|
2336
|
+
// }
|
|
2337
|
+
_setSelectedBlerp(bite);
|
|
2338
|
+
|
|
2339
|
+
case 26:
|
|
2340
|
+
case "end":
|
|
2341
|
+
return _context3.stop();
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}, _callee3);
|
|
2345
|
+
}));
|
|
2346
|
+
|
|
2347
|
+
return function play(_x) {
|
|
2348
|
+
return _ref4.apply(this, arguments);
|
|
2349
|
+
};
|
|
2350
|
+
}();
|
|
2351
|
+
|
|
2352
|
+
return /*#__PURE__*/React__default['default'].createElement(BlerpAudioContext.Provider, {
|
|
2353
|
+
value: {
|
|
2354
|
+
selectedBlerp: selectedBlerp,
|
|
2355
|
+
setSelectedBlerp: function setSelectedBlerp(_ref6) {
|
|
2356
|
+
var bite = _ref6.bite;
|
|
2357
|
+
|
|
2358
|
+
_setSelectedBlerp(bite);
|
|
2359
|
+
},
|
|
2360
|
+
pause: pause,
|
|
2361
|
+
play: play,
|
|
2362
|
+
stop: function () {
|
|
2363
|
+
var _stop = _asyncToGenerator__default['default']( /*#__PURE__*/_regeneratorRuntime__default['default'].mark(function _callee4() {
|
|
2364
|
+
var _audioRef$current;
|
|
2365
|
+
|
|
2366
|
+
return _regeneratorRuntime__default['default'].wrap(function _callee4$(_context4) {
|
|
2367
|
+
while (1) {
|
|
2368
|
+
switch (_context4.prev = _context4.next) {
|
|
2369
|
+
case 0:
|
|
2370
|
+
setPlayState("stopped");
|
|
2371
|
+
_context4.next = 3;
|
|
2372
|
+
return (_audioRef$current = audioRef.current) === null || _audioRef$current === void 0 ? void 0 : _audioRef$current.pause();
|
|
2373
|
+
|
|
2374
|
+
case 3:
|
|
2375
|
+
audioRef.current.currentTime = 0;
|
|
2376
|
+
|
|
2377
|
+
case 4:
|
|
2378
|
+
case "end":
|
|
2379
|
+
return _context4.stop();
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
}, _callee4);
|
|
2383
|
+
}));
|
|
2384
|
+
|
|
2385
|
+
function stop() {
|
|
2386
|
+
return _stop.apply(this, arguments);
|
|
2387
|
+
}
|
|
2388
|
+
|
|
2389
|
+
return stop;
|
|
2390
|
+
}(),
|
|
2391
|
+
getPlayState: function getPlayState(_ref7) {
|
|
2392
|
+
var biteId = _ref7.biteId;
|
|
2393
|
+
|
|
2394
|
+
if (biteId === (selectedBlerp && selectedBlerp._id)) {
|
|
2395
|
+
return playState;
|
|
2396
|
+
}
|
|
2397
|
+
},
|
|
2398
|
+
setStartTime: setStartTime
|
|
2399
|
+
}
|
|
2400
|
+
}, children);
|
|
2401
|
+
};
|
|
2402
|
+
|
|
2415
2403
|
var _templateObject$e, _templateObject2$9, _templateObject3$7, _templateObject4$6, _templateObject5$4, _templateObject6$4, _templateObject7$2;
|
|
2416
2404
|
var BlerpImage$1 = styled__default['default'].div(_templateObject$e || (_templateObject$e = _taggedTemplateLiteral__default['default'](["\n height: 150px;\n width: 150px;\n background-image: url(", ");\n background-size: cover;\n border-radius: 50%;\n position: relative;\n transition: 0.2s;\n\n &:hover {\n transform: scale(1.1);\n }\n"])), function (props) {
|
|
2417
2405
|
return props.url;
|
|
@@ -5704,7 +5692,7 @@
|
|
|
5704
5692
|
icons: icons,
|
|
5705
5693
|
mode: mode === "dark" ? "dark" : "light"
|
|
5706
5694
|
}, currentTheme)
|
|
5707
|
-
}, /*#__PURE__*/React__default['default'].createElement(SnackbarProvider, null,
|
|
5695
|
+
}, /*#__PURE__*/React__default['default'].createElement(SnackbarProvider, null, children)));
|
|
5708
5696
|
};
|
|
5709
5697
|
|
|
5710
5698
|
var LottieAnimation = function LottieAnimation(_ref) {
|