Close #5
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
interface Episode {
|
||||
@ -303,7 +303,13 @@ function EpisodeList() {
|
||||
<div style={{ display: "flex", gap: "8px" }}>
|
||||
<button
|
||||
className="btn btn-primary"
|
||||
onClick={() => playAudio(episode.audioPath.startsWith('/') ? episode.audioPath : `/podcast_audio/${episode.audioPath}`)}
|
||||
onClick={() =>
|
||||
playAudio(
|
||||
episode.audioPath.startsWith("/")
|
||||
? episode.audioPath
|
||||
: `/podcast_audio/${episode.audioPath}`,
|
||||
)
|
||||
}
|
||||
>
|
||||
再生
|
||||
</button>
|
||||
@ -314,13 +320,20 @@ function EpisodeList() {
|
||||
共有
|
||||
</button>
|
||||
</div>
|
||||
{currentAudio === (episode.audioPath.startsWith('/') ? episode.audioPath : `/podcast_audio/${episode.audioPath}`) && (
|
||||
{currentAudio ===
|
||||
(episode.audioPath.startsWith("/")
|
||||
? episode.audioPath
|
||||
: `/podcast_audio/${episode.audioPath}`) && (
|
||||
<div>
|
||||
<audio
|
||||
id={episode.audioPath}
|
||||
controls
|
||||
className="audio-player"
|
||||
src={episode.audioPath.startsWith('/') ? episode.audioPath : `/podcast_audio/${episode.audioPath}`}
|
||||
src={
|
||||
episode.audioPath.startsWith("/")
|
||||
? episode.audioPath
|
||||
: `/podcast_audio/${episode.audioPath}`
|
||||
}
|
||||
onEnded={() => setCurrentAudio(null)}
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user