-
Notifications
You must be signed in to change notification settings - Fork 282
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
How to Hide/Remove Playhead And Axis Label from Graph Canvas #464
Comments
This can't really be done at the moment, and would require new options to be added to the library. |
@sagharfrancis20 regarding playhead you can use workaround
I suppose this feature is not supported by design, but... it's javascript, so we can use private fields ;D |
Following code is remove the time frame from the label import React, { useEffect, useRef } from "react";
import Peaks from "peaks.js";
import "./WaveFormView.css";
function WaveFormView({ audioUrl, audioContentType, waveformDataUrl }) {
const zoomviewWaveformRef = useRef(null);
const overviewWaveformRef = useRef(null);
const audioElementRef = useRef(null);
let peaks = null;
useEffect(() => {
console.log("WaveformView component mount");
initPeaks();
return () => {
console.log("WaveformView will unmound!!!");
if (peaks) {
peaks.destroy();
}
};
}, [audioUrl]);
const initPeaks = () => {
const audioContext = new AudioContext();
const options = {
zoomview: {
container: zoomviewWaveformRef.current,
showAxisLabels: false,
},
overview: {
container: overviewWaveformRef.current,
showAxisLabels: false,
},
mediaElement: audioElementRef.current,
webAudio: {
audioContext: audioContext,
multiChannel: false,
},
//showPlayheadTime: true,
};
Peaks.init(options, (err, peaks) => {
if (err) {
console.log("Error===>", err, peaks);
//return;
}
console.log("===>", peaks);
peaks = peaks;
onPeaksReady();
});
};
const onPeaksReady = () => {
console.log("Peaks.js is now ready");
};
return (
<div>
<div className="zoomview-container" ref={zoomviewWaveformRef}></div>
<div className="overview-container" ref={overviewWaveformRef}></div>
<audio controls="controls" ref={audioElementRef}>
<source src={audioUrl} />
</audio>
</div>
);
}
export default WaveFormView; |
ba3c78f adds options to control the top/bottom axis markers. |
I don't want to use the waveform playhead and top axis label on the waveform. Is there any way to achieve it?
I tried giving a playhead a transparent color but it is still showing on waveform now it's very small in width and when I am trying to do the same with the axis but it applies on the bottom also.
The text was updated successfully, but these errors were encountered: