Skip to content

Commit

Permalink
Revert recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jjuback committed Apr 4, 2024
1 parent d11606e commit 94479a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Album.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ListGroup from 'react-bootstrap/ListGroup';
import Image from 'react-bootstrap/Image';
import Tabs from 'react-bootstrap/Tabs';
import Tab from 'react-bootstrap/Tab';
import MediaSession from '@mebtte/react-media-session';

export const Album = (props) => {
const [trackNo, setTrackNo] = useState(0);
Expand All @@ -14,13 +15,22 @@ export const Album = (props) => {
<Tabs defaultActiveKey="tracks" onSelect={(k) => k==="back" ? props.goBack() : {}}>
<Tab eventKey="back" title="<<" />
<Tab eventKey="tracks" title="Tracks">
<MediaSession
title={props.Tracks[trackNo].Title}
album={props.Title}
artist={props.Artist}
artwork={[
{ src: makeUrl(props.Cover), sizes: '96x96' }
]}
>
<audio controls src={makeUrl(props.Tracks[trackNo].Url)} autoPlay={trackNo > 0} onEnded={() => {
if (trackNo + 1 < props.Tracks.length) {
setTrackNo(trackNo + 1);
} else {
props.goBack();
}
}}/>
</MediaSession>
<ListGroup numbered>
{props && props.Tracks.map((data, key) => {
return (
Expand Down

0 comments on commit 94479a3

Please sign in to comment.