Ionic media streaming

Ionic media streaming



am having challenges implementing an audio API from shoutcast, currently working on a streaming radio app using Ionic. It refuses to play the audio when i stream using the audio API from shoutcase.



any help on this please? thanks




//playerservice

import Injectable from '@angular/core';
import Media, MediaObject from '@ionic-native/media';
import LoadingController, Platform from 'ionic-angular';

@Injectable()
export class PlayerServiceProvider

// This controls the alternating play and pause images and function
play: boolean = true;

// Property “radio” for the instance of the MediaObject for the Media plugin
radio: MediaObject

constructor(private media: Media, private platform: Platform, public loadingCtrl: LoadingController)
this.platform.ready().then(() =>
this.radio = this.media.create('http://yp.shoutcast.com/sbin/tunein-station.m3u?id=862132'); // Insert your own stream URL here.
this.radio.play();
);


// Function to play the audio stream
playAudio()

//Loading Spinner Configuration
const loading = this.loadingCtrl.create(
content: 'Loading stream...',
spinner: 'crescent',
showBackdrop: false,
cssClass: 'spin' // This class is defined in the app.scss file
);
loading.present();

setTimeout(() =>
loading.dismiss();
, 4000);
//End of Loading Spinner Configuration

// This controls the alternating play and pause images and function
this.play = false;



// Function to stop the audio stream
stopAudio()
this.radio.stop();

// This controls the alternating play and pause images and function
this.play = true;







u can try this it support streaming media --> ionicframework.com/docs/native/streaming-media
– Hitmacreed
Aug 22 at 10:39









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)