流媒体,什么是流媒体,图片、声音、文字、音频、视频传递信息的统称为媒体。流媒体,在云端流动的称之为流媒体
流媒体具有的特性,边下载边看,看完能缓存下来
真假流媒体
假流媒体: 看完缓存下来的媒体是乱,磁盘空间利用率不高
真流媒体:看完比较整齐,磁盘空间利用率高
iOS9.0以前,用到的播放器有
MPMoviePlayerController
self.mpc = [[MPMoviePlayerController alloc]initWithContentURL:_url]; // init
self.mpc.view.frame = CGRectMake(0, 200, 375, 200); // frame
[self.view addSubview:self.mpc.view]; // 添加view
[self.mpc play]; // 播放
MPMoviePlayerViewController
MPMoviePlayerViewController * mpvc = [[MPMoviePlayerViewController alloc]initWithContentURL:self.url];
[self presentMoviePlayerViewControllerAnimated:mpvc];
iOS9.0之后的播放控件,继承框架 AVFoundation
AVPlayer
AVPlayer * avplayer = [AVPlayer playerWithURL:self.url];
AVPlayerLayer * layer = [AVPlayerLayer playerLayerWithPlayer:avplayer];
layer.frame = self.view.bounds;
[self.view.layer addSublayer:layer];
[avplayer play];
真流媒体遵循的协议HLS协议,可以用的框架ERPlayer
直播视频 ffmpeg 遵循的协议RTMP协议,封装的第三方框架IJKPlayer