mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 17:58:02 -05:00
still broken
This commit is contained in:
@@ -33,8 +33,8 @@ const MediaPlayer = (props) => {
|
|||||||
const [playTime, setPlayTime] = useState(0);
|
const [playTime, setPlayTime] = useState(0);
|
||||||
const playSilence = props.playSilence;
|
const playSilence = props.playSilence;
|
||||||
const parentHandlePlayPause = props.onPlayPause
|
const parentHandlePlayPause = props.onPlayPause
|
||||||
const regionsPlugin = useMemo(() => RegionsPlugin.create(), []);
|
//const regionsPlugin = useMemo(() => RegionsPlugin.create(), []);
|
||||||
const plugins = useMemo(() => [regionsPlugin], [regionsPlugin]);
|
//const plugins = useMemo(() => [regionsPlugin], [regionsPlugin]);
|
||||||
|
|
||||||
// <WavesurferPlayer
|
// <WavesurferPlayer
|
||||||
// autoplay={true}
|
// autoplay={true}
|
||||||
@@ -59,7 +59,7 @@ const MediaPlayer = (props) => {
|
|||||||
barWidth: 3,
|
barWidth: 3,
|
||||||
barGap: 3,
|
barGap: 3,
|
||||||
barRadius: 6,
|
barRadius: 6,
|
||||||
plugins: plugins,
|
//plugins: plugins,
|
||||||
responsive: true,
|
responsive: true,
|
||||||
media: audioRef.current,
|
media: audioRef.current,
|
||||||
backend: 'MediaElement',
|
backend: 'MediaElement',
|
||||||
@@ -88,7 +88,7 @@ const MediaPlayer = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
audio.src = "/silence.m4a"; //wavesurfer.load("/silence.m4a");
|
audio.src = "/silence.m4a"; //wavesurfer.load("/silence.m4a");
|
||||||
regionsPlugin.clearRegions();
|
//regionsPlugin.clearRegions();
|
||||||
}
|
}
|
||||||
// // In browsers that don’t yet support this functionality,
|
// // In browsers that don’t yet support this functionality,
|
||||||
// // playPromise won’t be defined.
|
// // playPromise won’t be defined.
|
||||||
@@ -135,7 +135,7 @@ const MediaPlayer = (props) => {
|
|||||||
|
|
||||||
playPromise.then(function () {
|
playPromise.then(function () {
|
||||||
console.log("clearRegions");
|
console.log("clearRegions");
|
||||||
regionsPlugin.clearRegions();
|
/*regionsPlugin.clearRegions();
|
||||||
call.srcList.forEach(src => {
|
call.srcList.forEach(src => {
|
||||||
regionsPlugin.addRegion({
|
regionsPlugin.addRegion({
|
||||||
start: src.pos,
|
start: src.pos,
|
||||||
@@ -143,7 +143,7 @@ const MediaPlayer = (props) => {
|
|||||||
drag: false,
|
drag: false,
|
||||||
resize: false
|
resize: false
|
||||||
});
|
});
|
||||||
});
|
});*/
|
||||||
|
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
console.log("Automatic playback failed: " + error);
|
console.log("Automatic playback failed: " + error);
|
||||||
@@ -212,8 +212,7 @@ const MediaPlayer = (props) => {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="mediaplayer-item">
|
<div className="mediaplayer-item">
|
||||||
<div ref={containerRef} />
|
<span ref={containerRef} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="label-item">
|
<div className="label-item">
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ function useWavesurferInstance(containerRef, options) {
|
|||||||
setWavesurfer(ws)
|
setWavesurfer(ws)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
console.log('destroying wavesurfer')
|
||||||
ws.destroy()
|
ws.destroy()
|
||||||
}
|
}
|
||||||
}, [containerRef, ...flatOptions])
|
}, [containerRef, ...flatOptions])
|
||||||
|
|||||||
Reference in New Issue
Block a user