Git Product home page Git Product logo

Comments (12)

lijinke666 avatar lijinke666 commented on May 25, 2024 1

Hi~ Please reinstall [email protected] use like this

<ReactJkMusicPlayer  getContainer={()=> document.body}/>

// or

<ReactJkMusicPlayer  getContainer={()=> document.querySelector('.element')}/>

from react-music-player.

lijinke666 avatar lijinke666 commented on May 25, 2024

ok i'm publish a new version later . add a option getContainer support custom append root node

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

In previous version it was working fine, wherever i place markup <ReactJkMusicPlayer {...item.options} /> it render html on that node.

from react-music-player.

lijinke666 avatar lijinke666 commented on May 25, 2024

i'm sorry . i use import { createPortal } from "react-dom"; in 4.3.7 version to append document.body
because It will reduce some bugs

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

Hi~ Please reinstall [email protected] use like this

<ReactJkMusicPlayer  getContainer={()=> document.body}/>

// or

<ReactJkMusicPlayer  getContainer={()=> document.querySelector('.element')}/>

Use like this?
<ReactJkMusicPlayer getContainer={()=> document.querySelector('.audio-wrapper')} {...item.options} />

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

Options will remains same as it is?
<ReactJkMusicPlayer getContainer={()=> document.querySelector('.audio-wrapper')} {...item.options} />

from react-music-player.

lijinke666 avatar lijinke666 commented on May 25, 2024

yes no problem . cannot work ?

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

Its not working, it works only one at a time,
if i use this getContainer={()=> document.querySelector('.audio-wrapper')} then {...item.options} not getting option. vice versa.

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

oh sorry it works, but it does not shows timers, or seekbar and player options are not working

Reference: https://www.screencast.com/t/XqqVOzNuA

from react-music-player.

lijinke666 avatar lijinke666 commented on May 25, 2024

What is the item.options ?
It works in my local or live demo

so i don't know your error , can not give you help , or try

<ReactJkMusicPlayer  {...yourOptions} onAudioLoadError={(error)=> console.log(error)} /> 

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

Let me explain the complete scenario.
I've two player on my view and its rendering through .map function, every player have its own options, that's why i used item.options to assign every player its own options. there is no error in audio play. audio is playaing very well, but the options like seekbar not moving on audio play. timer not working.

Reference : https://www.screencast.com/t/McjkwkEFs5

Console Error: https://www.screencast.com/t/ejKxn3lFf

here is the code:
const renderMessage = (voiceMails) => {

    return voiceMails.map((item, index) => {
      
         item.options = {
            className: "audio-player",
            defaultPlayIndex: 0,
            theme: "light",                
            glassBg: false,
            defaultPosition: {},
            openText: "Open",
            closeText: "Close",
            mode: "full",
            once: true,
            autoPlay: false,
            toggleMode: false,
            showMiniModeCover: false,
            showMiniProcessBar: false,
            drag: true,
            seeked: true,
            showProgressLoadBar: false,
            showPlay: true,
            showReload: false,
            showDownload: false,
            showPlayMode: false,
            showThemeSwitch: true,
            showLyric: false,
            extendsContent: [],
            defaultVolume: 100,
            onAudioEnded(audioInfo) {
                //console.log("audio ended", audioInfo);
                readHandler(item.fromNumber, item.recordingSid)
            },
            onAudioSeeked(audioInfo) {
                console.log("audio seeked", audioInfo);
            },
            audioLists: [
                {
                    musicSrc: () => {
                        return Promise.resolve(item.recordingMp3Uri)
                    }

                },
            ]
        };


        return (
            <div className={"col-12 col-md-12 col-lg-10  col-xl-7"} key={index}>
                <div className="audio-wrap">                      
                    <div className="audio-ply"  id={"player-" + index}>
                        <ReactJkMusicPlayer  {...item.options} onAudioLoadError={(error)=> console.log(error)}  getContainer={()=> document.querySelector('#player-' + index)} />
                    </div>                                       
                </div>
            </div>
        )
    })
}

from react-music-player.

AhsanShafique avatar AhsanShafique commented on May 25, 2024

@lijinke666 any solution.

from react-music-player.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.