lhz516 / react-h5-audio-player

React audio player component with UI. It provides time indicator on both desktop and mobile devices.
https://codepen.io/lhz516/pen/dyGpmgP
MIT License
608 stars 92 forks source link

When I set this component to autoplay, the page does autoplay when loaded, but it cannot be paused. #214

Open w-66 opened 11 months ago

w-66 commented 11 months ago

When I set this component to autoplay, the page does autoplay when loaded, but it cannot be paused. autoPlay={true}

import React from 'react'
import { Row, Col } from 'antd'
import AudioPlayer from 'react-h5-audio-player';
import 'react-h5-audio-player/lib/styles.css';
//
export default function MusicPlayer(props) {
    console.log(444, props);
    return (
        <Row>
            <Col span={24}
                style={{
                    position: "absolute", bottom: 0,
                    // border:'solid',
                    width: "100%"
                }}
            >
                <AudioPlayer
                    autoPlay={false}
                    {...props}
                />
            </Col>
        </Row>
    )
}
ve-varun-sharma commented 11 months ago

@w-66 what version of chrome or what browser were you using when this happened? For us auto play happens automatically even when false

lhz516 commented 11 months ago

My guess is that the client side pause action triggers some edge case errors. Could you check your browser console and provide some screenshots if there's error while clicking pause button?

w-66 commented 10 months ago

@print-VarunSharma I'm using Chrome 119.0

lhz516 commented 10 months ago

@w-66 Check the "Update Intervals" examples in the Storybook. They are autoplay enabled. https://lhz516.github.io/react-h5-audio-player I don't see any issues here in Chrome 119