Is possible to stop audio stream?

Is possible to stop the download stream on Ionic?

i have this function

export class RadioPlayer {
    url: string;
    stream: any;
    promise: any;

    constructor() {
    };

    play() {
        this.url = "http://109.168.100.173:8058/;stream.mp3";
        this.stream = new Audio(this.url);
        this.stream.play();
        this.promise = new Promise((resolve, reject) => {
            this.stream.addEventListener('playing', () => {
                resolve(true);
            });

            this.stream.addEventListener('error', () => {
                reject(false);
            });
        });
        return this.promise;
    };

    pause() {
        if (this.stream != null) {
            this.stream.pause();


        }
        this.stream = null;
    }

    stop() {
        if (this.stream != null) {
            this.stream.pause();
            this.url = "";
        }
        this.stream = null;
    }

}

If i click on play it works but if i click on stop the device continue download of streaming.

is possible to stop the download of streaming?

Thank You

What is this exactly? Which library are you using? Without that context, we can’t investigate.

Fillipo, just set this.stream = “” instead of null. It worked for me.