零散知识点记录

设置UIView的阴影效果:

    [[self.view layer] setShadowOffset:CGSizeMake(2, 2)];
    [[self.view layer] setShadowRadius:6];
    [[self.view layer] setShadowOpacity:1]; 
    [[self.view layer] setShadowColor:[UIColor blackColor].CGColor];



        MPMoviePlayerViewController* tmpMoviePlayViewController=[[[MPMoviePlayerViewController alloc] initWithContentURL:URL] autorelease];
        if (tmpMoviePlayViewController)
        {
            tmpMoviePlayViewController.moviePlayer.shouldAutoplay = NO;
            tmpMoviePlayViewController.view.userInteractionEnabled = NO;// 设置这个VIEW不响应事件,会将所有事件传给它的superview
            [tmpMoviePlayViewController.view setFrame: self.view.bounds];
            tmpMoviePlayViewController.moviePlayer.controlStyle = MPMovieControlStyleNone;// 去除视频播放器的所有风格
            
            [self presentMoviePlayerViewControllerAnimated:tmpMoviePlayViewController];
            [self.view addSubview:tmpMoviePlayViewController.view];
            
            self.moviePlayer = tmpMoviePlayViewController;
            [tmpMoviePlayViewController release];
        } 



获取视屏播放的当前事件、总时长、开始播放事件等	
	NSTimeInterval currentTime = self.movieController.moviePlayer.moviePlayer.currentPlaybackTime;// 获取视频播放的当前时间
    	NSTimeInterval duration = self.movieController.moviePlayer.moviePlayer.duration;// 获取总时长

NSTimeInterval转换成时分秒NSString类型:
    NSString *string = [NSString stringWithFormat:@"%02li:%02li:%02li",
                        lround(floor(time / 3600.)) % 100,
                        lround(floor(time / 60.)) % 60,
                        lround(floor(time / 1.)) % 60];
    NSLog(@"%f, %@", time, string);




UISlider的用发:

    UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(20, 800, 768, 10)];
    self.moviePlayerProgress = slider;
    [slider release];
    
    [self.view addSubview:self.moviePlayerProgress];

    self.moviePlayerProgress.minimumValue = 0.0;
    self.moviePlayerProgress.maximumValue = 100;
    [self.moviePlayerProgress setValue:currentTime animated:YES];

// 相应事件

[self.moviePlayerProgressaddTarget:selfaction:@selector(valueChange)forControlEvents:UIControlEventTouchUpInside];


- (void) valueChange

{

    float value =self.moviePlayerProgress.value;

}










你可能感兴趣的:(String,url,UIView,360,float,layer)