Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
w-66 opened this issue Oct 14, 2023 · 4 comments

Comments

@w-66
Copy link

w-66 commented Oct 14, 2023

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
Copy link

@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
Copy link
Owner

lhz516 commented Nov 2, 2023

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
Copy link
Author

w-66 commented Dec 6, 2023

@print-VarunSharma I'm using Chrome 119.0

@lhz516
Copy link
Owner

lhz516 commented Dec 11, 2023

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants