1. Streaming media refers to the use of streaming technology in internet/intranet for continuous time-based media, such as audio, video or multimedia files. Streaming media does not download the entire file before playback, only the beginning of the content into memory, streaming media stream at any time to play, but at the beginning of some delay. The key technology of streaming media implementation is streaming.
2. The streaming address here refers to the video stream that has been formatted on the server side that can be played on iOS.
Example: Http://www.jxvdy.com/file/upload/201309/18/18-10-03-19-3.mp4
3.iOS Movies Play MediaPlayer and Avplayer (framework)
At iOS developers, if you're going to encounter a movie, such as a boot animation, we're accustomed to using MediaPlayer to play the movie, because it's easy to use, so keep using it. But the more demanding the customer is, the more serious it is, especially when it comes to the animation or interaction effect. So if you gimps with a film in some of the animations, the machine will not run. So after iOS 4, we can use Avplayer to do a more subtle operation.
Note:
- MediaPlayer's film is placed in the UIView, and Avplayer is placed in Avplayerlayer, Avplayerlayer is the sub-category of Calayer.
- Before using MediaPlayer, remember to join Mediaplayer.framework and #import <MediaPlayer/MediaPlayer.h>
- Before using Avplayer, remember to join AVFOUNDATION.FRAMEWORKK and #import <AVFoundation/AVFoundation.h>
Please refer to the following example:
Use MediaPlayer to play a movie
NSString *filepath = [[NSBundle mainbundle] Pathforresource:@"BACKSPACE"OfType:@"mov"]; Nsurl*sourcemovieurl =[Nsurl Fileurlwithpath:filepath]; MoviePlayer=[[MPMoviePlayerController alloc] initwithcontenturl:sourcemovieurl]; MoviePlayer.view.frame=cgrectmake (0,0,1024x768,768); Movieplayer.controlstyle=Mpmoviecontrolstylenone; //Play the movie![Self.view AddSubview:moviePlayer.view];
Use Avplayer to play the movie:
NSString *filepath = [[NSBundle mainbundle] Pathforresource:@"BACKSPACE"OfType:@"mov"]; Nsurl*sourcemovieurl =[Nsurl Fileurlwithpath:filepath]; Avasset*movieasset =[Avurlasset Urlassetwithurl:sourcemovieurl Options:nil]; Avplayeritem*playeritem =[Avplayeritem Playeritemwithasset:movieasset]; Avplayer*player =[Avplayer Playerwithplayeritem:playeritem]; Avplayerlayer*playerlayer =[Avplayerlayer Playerlayerwithplayer:player]; Playerlayer.frame=Self.view.layer.bounds; Playerlayer.videogravity=Avlayervideogravityresizeaspect; [Self.view.layer Addsublayer:playerlayer]; [Player play];