import React, { Component } from "react"; import PropTypes from "prop-types"; import { connect } from "react-redux"; @connect(state => ({ volume: state.volume.get("loudness"), muted: state.volume.get("muted"), songId: state.station.currentSong.get("songId"), duration: state.station.currentSong.getIn(["timings", "duration"]), skipDuration: state.station.currentSong.getIn(["timings", "skipDuration"]), timeElapsed: state.station.currentSong.getIn(["timings", "timeElapsed"]), timePaused: state.station.currentSong.getIn(["timings", "timePaused"]), pausedAt: state.station.currentSong.getIn(["timings", "pausedAt"]), startedAt: state.station.currentSong.getIn(["timings", "startedAt"]), exists: state.station.currentSong.get("songId") !== "", paused: state.station.info.get("paused"), mode: state.station.info.get("mode"), privatePlaylistQueue: state.station.info.get("privatePlaylistQueue"), })) export default class PlayerDebug extends Component { static propTypes = { }; static defaultProps = { }; constructor(props) { super(props); } /*getTimeElapsed = () => { if (this.props.exists) { // TODO Replace with Date.currently let timePausedNow = 0; if (this.props.paused) timePausedNow = Date.now() - this.props.pausedAt; return Date.now() - this.props.startedAt - this.props.timePaused - timePausedNow; } else return 0; };*/ render() { return (