react-h5-audio-player icon indicating copy to clipboard operation
react-h5-audio-player copied to clipboard

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

Open w-66 opened this issue 2 years ago • 4 comments
trafficstars

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>
    )
}

w-66 avatar Oct 14 '23 17:10 w-66

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

VeVarunSharma avatar Oct 18 '23 16:10 VeVarunSharma

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?

lhz516 avatar Nov 02 '23 18:11 lhz516

@print-VarunSharma I'm using Chrome 119.0

w-66 avatar Dec 06 '23 06:12 w-66

@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

lhz516 avatar Dec 11 '23 06:12 lhz516