Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react video srcObject

playTrack(track) {
    const stream = new MediaStream()
    stream.addTrack(track)
    this.audio.srcObject = stream;
}

render() {
    return (
        <audio ref={audio => {this.audio = audio}} controls volume="true" autoPlay />
    )
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #video #srcObject
ADD COMMENT
Topic
Name
8+6 =