Created
November 11, 2015 04:09
-
-
Save melice/fcdd2ff0da57af208a2f to your computer and use it in GitHub Desktop.
play a stream media
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MPMoviePlayerViewController? imcomplete