Skip to content

Instantly share code, notes, and snippets.

@melice
Created November 11, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melice/fcdd2ff0da57af208a2f to your computer and use it in GitHub Desktop.
Save melice/fcdd2ff0da57af208a2f to your computer and use it in GitHub Desktop.
play a stream media
uses
iOSapi.Foundation, iOSapi.MediaPlayer, FMX.Platform.iOS;
Type
TForm1 = Class( TForm )
Procedure FormCreate( Sender: TObject );
Private
{ Private declarations }
Public
{ Public declarations }
MPlayer : MPMoviePlayerViewController;
End;
Procedure TForm1.FormCreate( Sender: TObject );
Var
URL : NSURL;
URLStr: String;
Begin
URLStr := 'Http://webradio.antennevorarlberg.at:80/classicrock'; // <----- *Add here you video stream URL*
URL := TNSUrl.Wrap( TNSUrl.OCClass.URLWithString( NSStr( URLStr ) ) );
MPlayer := TMPMoviePlayerViewController.Wrap( TMPMoviePlayerViewController.Alloc.InitWithContentURL( URL ) );
MPlayer.MoviePlayer.SetMovieSourceType( MPMovieSourceTypeStreaming );
WindowHandleToPlatform( Self.Handle ).View.AddSubview( MPlayer.view );
MPlayer.Retain;
End;
//- See more at: http://codeverge.com/embarcadero.delphi.firemonkey/is-media-player-support-live-vi/1052586#sthash.nMR1IYin.dpuf
@johnbh3
Copy link

johnbh3 commented Jan 10, 2024

MPMoviePlayerViewController? imcomplete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment