zoukankan      html  css  js  c++  java
  • 网路视频播放-ios

    -(void)playMovie
    {
    
        NSURL *urls = [NSURL URLWithString:[NSString stringWithFormat:@"http://www.3dhr.gov.cn%@",[self.detailDic objectForKey:@"m_path"]]];
        movie = [[MPMoviePlayerController alloc]initWithContentURL:urls];
        movie.controlStyle = MPMovieControlStyleDefault;
        [movie prepareToPlay];
        [movie.view setFrame:CGRectMake(0, 0, 320, [UIScreen mainScreen].bounds.size.height-60)];
        movie.movieSourceType = MPMovieSourceTypeFile;
        movie.initialPlaybackTime = -1;
        [self.view addSubview:movie.view];
        //注册一个播放结束的通知
        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(myMovieFinishedCallback:)
                                                     name:MPMoviePlayerPlaybackDidFinishNotification
                                                   object:movie];
        [movie play];
    //    movie.shouldAutoplay =YES;
        
        UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"关闭" style:UIBarButtonItemStyleBordered target:self action:@selector(closeMovie)];
        [self.navigationItem setRightBarButtonItem:rightBarButtonItem];
        [rightBarButtonItem release];
    }
  • 相关阅读:
    python 返回函数的使用
    你的服务器还在裸奔吗?
    云计算产品vSwitch原理
    网卡创建Bond
    UI自动化框架介绍
    常用底层linux命令
    Linux Bridge基本概念
    磁盘格式化及设置自动挂载
    Linux vi文本编辑器常用命令
    MySQL5.7安装方式
  • 原文地址:https://www.cnblogs.com/jiackyan/p/3109793.html
Copyright © 2011-2022 走看看