|
@@ -126,14 +126,15 @@
|
|
|
if ([asset isKindOfClass:[AVURLAsset class]]) {
|
|
|
|
|
|
AVURLAsset* urlAsset = (AVURLAsset*)asset;
|
|
|
- NSData *videoData = [NSData dataWithContentsOfURL:urlAsset.URL];
|
|
|
-// NSNumber *size;
|
|
|
-// [urlAsset.URL getResourceValue:&size forKey:NSURLFileSizeKey error:nil];
|
|
|
-// NSLog(@"size is %f",[size floatValue]/(1024.0*1024.0));
|
|
|
+ //NSData *videoData = [NSData dataWithContentsOfURL:urlAsset.URL];
|
|
|
+ NSNumber *size;
|
|
|
+ [urlAsset.URL getResourceValue:&size forKey:NSURLFileSizeKey error:nil];
|
|
|
+ //NSLog(@"size is %f",[size floatValue]/(1024.0*1024.0));
|
|
|
|
|
|
|
|
|
//model.videoData = videoData;
|
|
|
- model.totalBytes = [videoData length];
|
|
|
+ //model.totalBytes = [videoData length];
|
|
|
+ model.totalBytes = size.longLongValue;
|
|
|
[self setDataToBottomViewFun];
|
|
|
}
|
|
|
}];
|
|
@@ -301,7 +302,8 @@
|
|
|
CGFloat offSetWidth = scrollView.contentOffset.x;
|
|
|
offSetWidth = offSetWidth + (SCREEN_W * 0.5);
|
|
|
|
|
|
- NSInteger currentIndex = offSetWidth / (SCREEN_W + 20);
|
|
|
+ //NSInteger currentIndex = offSetWidth / (SCREEN_W + 20);
|
|
|
+ NSInteger currentIndex = offSetWidth / (SCREEN_W);
|
|
|
if (currentIndex < _assets.count && _currentIndex != currentIndex && _canSetCurrentIndex)
|
|
|
{
|
|
|
_currentIndex = currentIndex;
|