diff --git a/src/components/node/Comment/index.tsx b/src/components/node/Comment/index.tsx index bc730eba..ddc4b241 100644 --- a/src/components/node/Comment/index.tsx +++ b/src/components/node/Comment/index.tsx @@ -10,6 +10,7 @@ import assocPath from 'ramda/es/assocPath'; import append from 'ramda/es/append'; import reduce from 'ramda/es/reduce'; import { UPLOAD_TYPES } from '~/redux/uploads/constants'; +import { Player } from '~/utils/player'; type IProps = HTMLAttributes & { is_empty?: boolean; @@ -53,7 +54,9 @@ const Comment: FC = ({ comment, is_empty, is_loading, className, photo, {groupped.audio && (
{groupped.audio.map(file => ( -
{file.name}
+
Player.setSrc(getURL(file.url))}> + {file.name} +
))}
)} diff --git a/src/utils/player.ts b/src/utils/player.ts index 6371b575..121c20ca 100644 --- a/src/utils/player.ts +++ b/src/utils/player.ts @@ -4,8 +4,7 @@ Howl.prototype.setSrc = function setSrc(src) { this.unload(); this._src = src; this.load(); + this.play(); }; export const Player = new Howl({ src: [''] }); - -console.log('PLAYER', Player);