sense-react-timeline-editor 1.1.34 → 1.1.35

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.esm.js CHANGED
@@ -5,7 +5,7 @@ import { prefixNames } from 'framework-utils';
5
5
  import interact from 'interactjs';
6
6
  import { useSelectionContainer } from '@air/react-drag-to-select';
7
7
  import { message } from 'antd/es';
8
- import { Howl } from 'howler';
8
+ import 'howler';
9
9
  import { groupBy, throttle } from 'lodash-es';
10
10
  import useSize from 'ahooks/es/useSize';
11
11
 
@@ -3579,26 +3579,6 @@ var useRowDrag = function useRowDrag(options) {
3579
3579
  };
3580
3580
  };
3581
3581
 
3582
- // 获取音频时长
3583
- var getAudioDuration = function getAudioDuration(url) {
3584
- return new Promise(function (resolve) {
3585
- var sound = new Howl({
3586
- src: url
3587
- });
3588
- sound.on('load', function () {
3589
- resolve(sound.duration());
3590
- sound.unload();
3591
- });
3592
- setTimeout(function () {
3593
- resolve(2); // 加载失败时返回默认时长2秒
3594
- sound.unload();
3595
- }, 6 * 1000); // 60秒超时 60 * 1000
3596
- sound.on('loaderror', function () {
3597
- resolve(2); // 加载失败时返回默认时长2秒
3598
- sound.unload();
3599
- });
3600
- });
3601
- };
3602
3582
  var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3603
3583
  var className = props.className,
3604
3584
  _props$isMulti = props.isMulti,
@@ -3650,7 +3630,7 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3650
3630
  return /*#__PURE__*/function () {
3651
3631
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(info) {
3652
3632
  var _info$file$response, _info$file, _info$file$response2;
3653
- var maxSize, hasDefault, totalDuration, _newAction, uid, duration, newAction;
3633
+ var maxSize, hasDefault, totalDuration, _newAction, uid, newAction;
3654
3634
  return _regenerator().w(function (_context) {
3655
3635
  while (1) switch (_context.n) {
3656
3636
  case 0:
@@ -3720,17 +3700,13 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3720
3700
  return _context.a(2);
3721
3701
  case 5:
3722
3702
  uid = info.file.uid;
3723
- _context.n = 6;
3724
- return getAudioDuration(info.file.response.url);
3725
- case 6:
3726
- duration = _context.v;
3727
3703
  newAction = {
3728
3704
  id: ((_info$file$response = info.file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.id) || uid,
3729
3705
  effectId: 'custom_video_effect',
3730
3706
  flexible: true,
3731
3707
  url: info.file.response.url,
3732
3708
  start: currentMouseTime,
3733
- end: currentMouseTime + duration,
3709
+ end: currentMouseTime + 1000,
3734
3710
  isUpload: true,
3735
3711
  segment_type: 'bgm',
3736
3712
  isUploading: false,
@@ -3738,7 +3714,7 @@ var EditAreaO = /*#__PURE__*/React.forwardRef(function (props, ref) {
3738
3714
  waveform: ((_info$file$response2 = info.file.response) === null || _info$file$response2 === void 0 ? void 0 : _info$file$response2.peaks) || []
3739
3715
  };
3740
3716
  onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [newAction]);
3741
- case 7:
3717
+ case 6:
3742
3718
  return _context.a(2);
3743
3719
  }
3744
3720
  }, _callee);
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var frameworkUtils = require('framework-utils');
9
9
  var interact = require('interactjs');
10
10
  var reactDragToSelect = require('@air/react-drag-to-select');
11
11
  var es = require('antd/es');
12
- var howler = require('howler');
12
+ require('howler');
13
13
  var lodashEs = require('lodash-es');
14
14
  var useSize = require('ahooks/es/useSize');
15
15
 
@@ -3589,26 +3589,6 @@ var useRowDrag = function useRowDrag(options) {
3589
3589
  };
3590
3590
  };
3591
3591
 
3592
- // 获取音频时长
3593
- var getAudioDuration = function getAudioDuration(url) {
3594
- return new Promise(function (resolve) {
3595
- var sound = new howler.Howl({
3596
- src: url
3597
- });
3598
- sound.on('load', function () {
3599
- resolve(sound.duration());
3600
- sound.unload();
3601
- });
3602
- setTimeout(function () {
3603
- resolve(2); // 加载失败时返回默认时长2秒
3604
- sound.unload();
3605
- }, 6 * 1000); // 60秒超时 60 * 1000
3606
- sound.on('loaderror', function () {
3607
- resolve(2); // 加载失败时返回默认时长2秒
3608
- sound.unload();
3609
- });
3610
- });
3611
- };
3612
3592
  var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (props, ref) {
3613
3593
  var className = props.className,
3614
3594
  _props$isMulti = props.isMulti,
@@ -3660,7 +3640,7 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3660
3640
  return /*#__PURE__*/function () {
3661
3641
  var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(info) {
3662
3642
  var _info$file$response, _info$file, _info$file$response2;
3663
- var maxSize, hasDefault, totalDuration, _newAction, uid, duration, newAction;
3643
+ var maxSize, hasDefault, totalDuration, _newAction, uid, newAction;
3664
3644
  return _regenerator().w(function (_context) {
3665
3645
  while (1) switch (_context.n) {
3666
3646
  case 0:
@@ -3730,17 +3710,13 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3730
3710
  return _context.a(2);
3731
3711
  case 5:
3732
3712
  uid = info.file.uid;
3733
- _context.n = 6;
3734
- return getAudioDuration(info.file.response.url);
3735
- case 6:
3736
- duration = _context.v;
3737
3713
  newAction = {
3738
3714
  id: ((_info$file$response = info.file.response) === null || _info$file$response === void 0 ? void 0 : _info$file$response.id) || uid,
3739
3715
  effectId: 'custom_video_effect',
3740
3716
  flexible: true,
3741
3717
  url: info.file.response.url,
3742
3718
  start: currentMouseTime,
3743
- end: currentMouseTime + duration,
3719
+ end: currentMouseTime + 1000,
3744
3720
  isUpload: true,
3745
3721
  segment_type: 'bgm',
3746
3722
  isUploading: false,
@@ -3748,7 +3724,7 @@ var EditAreaO = /*#__PURE__*/React__default['default'].forwardRef(function (prop
3748
3724
  waveform: ((_info$file$response2 = info.file.response) === null || _info$file$response2 === void 0 ? void 0 : _info$file$response2.peaks) || []
3749
3725
  };
3750
3726
  onUpdateEditorData === null || onUpdateEditorData === void 0 ? void 0 : onUpdateEditorData(row, [newAction]);
3751
- case 7:
3727
+ case 6:
3752
3728
  return _context.a(2);
3753
3729
  }
3754
3730
  }, _callee);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sense-react-timeline-editor",
3
- "version": "1.1.34",
3
+ "version": "1.1.35",
4
4
  "author": "xzdarcy",
5
5
  "license": "MIT",
6
6
  "keywords": [