Commit 4410acbaeaadee817dcf2282b040de81150c4f31

Authored by yanglingyu
1 parent a699a1dd

点击延时问题

CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
@@ -42,10 +42,16 @@ @@ -42,10 +42,16 @@
42 url = [url stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; 42 url = [url stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
43 movieUrl = [NSURL URLWithString:url]; 43 movieUrl = [NSURL URLWithString:url];
44 videoHeight = MainScreenWidth * (9.0 / 16.0); 44 videoHeight = MainScreenWidth * (9.0 / 16.0);
45 - if(!(0 == [_dictionary[@"img"] length])){  
46 - NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:_dictionary[@"img"]]];  
47 - bgImg = [UIImage imageWithData:data];  
48 - } 45 + dispatch_async(dispatch_get_global_queue(0, 0), ^{
  46 + if(!(0 == [self->_dictionary[@"img"] length])){
  47 + NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"img"]]];
  48 + self->bgImg = [UIImage imageWithData:data];
  49 + if (self.videoController && self->bgImg) {
  50 + self.videoController.view.contentMode=UIViewContentModeScaleAspectFit;
  51 + self.videoController.view.layer.contents=(__bridge id _Nullable)(self->bgImg.CGImage);
  52 + }
  53 + }
  54 + });
49 } 55 }
50 return self; 56 return self;
51 } 57 }