码迷,mamicode.com
首页 > 其他好文 > 详细

视频播放

时间:2015-10-10 10:18:25      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

1. 导入头文件  

#import <MediaPlayer/MediaPlayer.h>

方式一:MPMoviePlayerController
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"笑傲江湖——东方不败外传_高清" withExtension:@"mp4"];
    
    _mvPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
    
    [_mvPlayer prepareToPlay];
    
    _mvPlayer.view.frame = CGRectMake(0, 100, 375, 568);
    
    [self.view addSubview:_mvPlayer.view];

方式二:MPMoviePlayerViewController

    NSURL *url = [[NSBundle mainBundle] URLForResource:@"笑傲江湖——东方不败外传_高清" withExtension:@"mp4"];
    MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
    
    // 设置模态显示过度效果
    player.modalTransitionStyle = 
    UIModalTransitionStyleCrossDissolve;
    
    // 以模态方式显示视频界面
    [self presentMoviePlayerViewControllerAnimated:player];

 

流媒体测试网站:

http://live.3gv.ifeng.com/live/hongkong.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819/nexttvnews_hls/StreamEdge.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819-b/nexttvnews_hls/StreamEdge.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819/nexttvnews_hls/StreamMobLow.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819-b/nexttvnews_hls/StreamMobLow.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819/nexttvnews_hls/StreamMobHigh.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819-b/nexttvnews_hls/StreamMobHigh.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819/nexttvnews_hls/StreamWifi.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819-b/nexttvnews_hls/StreamWifi.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819/nexttvnews_hls/StreamEdgeaudio.m3u8

http://nexttvnews_hls-i.akamaihd.net/hls/live/215819-b/nexttvnews_hls/StreamEdgeaudio.m3u8

 


?????????? ????????????????????

  ????????????????????????????????????
  ????????????
  ????????????????????????????
  ??????????????????????????????????????

视频播放

标签:

原文地址:http://www.cnblogs.com/10-19-92/p/4865766.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!