Commit fec9ac1d963eaa32cd4e3e24bf7c4914b2d2ec86

Authored by yanglingyu
1 parent cdc3408e

解决英文video播放时长不对问题,收藏音频更改图片

CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
@@ -46,8 +46,8 @@ @@ -46,8 +46,8 @@
46 movieUrl = [NSURL URLWithString:url]; 46 movieUrl = [NSURL URLWithString:url];
47 videoHeight = MainScreenWidth * (9.0 / 16.0); 47 videoHeight = MainScreenWidth * (9.0 / 16.0);
48 dispatch_async(dispatch_get_global_queue(0, 0), ^{ 48 dispatch_async(dispatch_get_global_queue(0, 0), ^{
49 - if(!(0 == [self->_dictionary[@"img"] length])){  
50 - NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"img"]]]; 49 + if(!(0 == [self->_dictionary[@"imgSmall"] length])){
  50 + NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:self->_dictionary[@"imgSmall"]]];
51 self->bgImg = [UIImage imageWithData:data]; 51 self->bgImg = [UIImage imageWithData:data];
52 dispatch_async(dispatch_get_main_queue(), ^{ 52 dispatch_async(dispatch_get_main_queue(), ^{
53 if (self.videoController && self->bgImg) { 53 if (self.videoController && self->bgImg) {
CNLiveScioLive/Pages/Tools/DBAction/DBAction.m
@@ -127,15 +127,15 @@ static DBAction *instance = nil; @@ -127,15 +127,15 @@ static DBAction *instance = nil;
127 - (void)createTable:(NSString *)tableName{ 127 - (void)createTable:(NSString *)tableName{
128 if ([db open]) { 128 if ([db open]) {
129 tableName = [tableName substringToIndex:2]; 129 tableName = [tableName substringToIndex:2];
130 - NSString * sql = [NSString stringWithFormat:@"CREATE TABLE %@DATATABLE (cmsColumnName varchar, cmsColumnId varchar, cmsContentId int, createDate varchar, desc varchar, gxbArticleId int, gxbVideoId int, img varchar, pageUrl varchar, picType varchar, playType varchar, publishDate varchar, subTitle varchar, title varchar, type varchar, uploadVideoUrl varchar, videoUrl varchar, vipFlag int, uuid varchar)",tableName.uppercaseString]; 130 + NSString * sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS %@SDATATABLE (cmsColumnName varchar, cmsColumnId varchar, cmsContentId int, createDate varchar, desc varchar, gxbArticleId int, gxbVideoId int, img varchar,imgSmall varchar, pageUrl varchar, picType varchar, playType varchar, publishDate varchar, subTitle varchar, title varchar, type varchar, uploadVideoUrl varchar, videoUrl varchar, vipFlag int, uuid varchar,author varchar)",tableName.uppercaseString];
131 BOOL res = [db executeUpdate:sql]; 131 BOOL res = [db executeUpdate:sql];
132 if (!res) { 132 if (!res) {
133 NSLog(@"建表失败"); 133 NSLog(@"建表失败");
134 134
135 - NSString *sql1 = [NSString stringWithFormat:@"ALTER TABLE %@DATATABLE ADD %@ VARCHAR",tableName,@"playType"]; 135 + NSString *sql1 = [NSString stringWithFormat:@"ALTER TABLE %@SDATATABLE ADD %@ VARCHAR",tableName,@"playType"];
136 BOOL result1 = [db executeUpdate:sql1]; 136 BOOL result1 = [db executeUpdate:sql1];
137 137
138 - NSString *sql2 = [NSString stringWithFormat:@"ALTER TABLE %@DATATABLE ADD %@ VARCHAR",tableName,@"uuid"]; 138 + NSString *sql2 = [NSString stringWithFormat:@"ALTER TABLE %@SDATATABLE ADD %@ VARCHAR",tableName,@"uuid"];
139 BOOL result2 = [db executeUpdate:sql2]; 139 BOOL result2 = [db executeUpdate:sql2];
140 140
141 } else { 141 } else {
@@ -150,7 +150,7 @@ static DBAction *instance = nil; @@ -150,7 +150,7 @@ static DBAction *instance = nil;
150 - (BOOL)isInTable:(NSString *)tableName notice:(TableData*)notice{ 150 - (BOOL)isInTable:(NSString *)tableName notice:(TableData*)notice{
151 if ([db open]) { 151 if ([db open]) {
152 tableName = [tableName substringToIndex:2]; 152 tableName = [tableName substringToIndex:2];
153 - NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@DATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; 153 + NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@SDATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId];
154 FMResultSet * re = [db executeQuery:check]; 154 FMResultSet * re = [db executeQuery:check];
155 while ([re next]) { 155 while ([re next]) {
156 return YES; 156 return YES;
@@ -163,12 +163,12 @@ static DBAction *instance = nil; @@ -163,12 +163,12 @@ static DBAction *instance = nil;
163 - (BOOL)insertTable:(NSString *)tableName notice:(TableData*)notice{ 163 - (BOOL)insertTable:(NSString *)tableName notice:(TableData*)notice{
164 if ([db open]) { 164 if ([db open]) {
165 tableName = [tableName substringToIndex:2]; 165 tableName = [tableName substringToIndex:2];
166 - NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@DATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; 166 + NSString * check = [NSString stringWithFormat:@"SELECT * FROM %@SDATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId];
167 FMResultSet * re = [db executeQuery:check]; 167 FMResultSet * re = [db executeQuery:check];
168 if (![re next]) { 168 if (![re next]) {
169 NSString *desc = [notice.desc stringByReplacingOccurrencesOfString:@"'" withString:@"''"]; 169 NSString *desc = [notice.desc stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
170 NSString *title = [notice.title stringByReplacingOccurrencesOfString:@"'" withString:@"‘"]; 170 NSString *title = [notice.title stringByReplacingOccurrencesOfString:@"'" withString:@"‘"];
171 - NSString * sql = [NSString stringWithFormat:@"INSERT INTO %@DATATABLE (cmsColumnName, cmsColumnId, cmsContentId, createDate, desc, gxbArticleId, gxbVideoId, img, pageUrl, picType, playType, publishDate, subTitle, title, type, uploadVideoUrl, videoUrl, vipFlag, uuid) values('%@','%@','%d', '%@','%@','%d','%d', '%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%d', '%@')",tableName.uppercaseString, notice.cmsColumnName, notice.cmsColumnId, notice.cmsContentId, notice.createDate, desc, notice.gxbArticleId, notice.gxbVideoId, notice.img, notice.pageUrl, notice.picType, notice.playType, notice.publishDate, notice.subTitle, title, notice.type, notice.uploadVideoUrl, notice.videoUrl, notice.vipFlag, notice.uuid?notice.uuid:@""]; 171 + NSString * sql = [NSString stringWithFormat:@"INSERT INTO %@SDATATABLE (cmsColumnName, cmsColumnId, cmsContentId, createDate, desc, gxbArticleId, gxbVideoId, img, imgSmall, pageUrl, picType, playType, publishDate, subTitle, title, type, uploadVideoUrl, videoUrl, vipFlag, uuid,author) values('%@','%@','%d', '%@','%@','%d','%d', '%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%d', '%@','%@')",tableName.uppercaseString, notice.cmsColumnName, notice.cmsColumnId, notice.cmsContentId, notice.createDate, desc, notice.gxbArticleId, notice.gxbVideoId, notice.img, notice.imgSmall, notice.pageUrl, notice.picType, notice.playType, notice.publishDate, notice.subTitle, title, notice.type, notice.uploadVideoUrl, notice.videoUrl, notice.vipFlag, notice.uuid?notice.uuid:@"",notice.author];
172 BOOL res = [db executeUpdate:sql]; 172 BOOL res = [db executeUpdate:sql];
173 if (!res) { 173 if (!res) {
174 return NO; 174 return NO;
@@ -184,7 +184,7 @@ static DBAction *instance = nil; @@ -184,7 +184,7 @@ static DBAction *instance = nil;
184 - (BOOL)deleteTable:(NSString *)tableName notice:(TableData*)notice{ 184 - (BOOL)deleteTable:(NSString *)tableName notice:(TableData*)notice{
185 if ([db open]) { 185 if ([db open]) {
186 tableName = [tableName substringToIndex:2]; 186 tableName = [tableName substringToIndex:2];
187 - NSString * sql = [NSString stringWithFormat:@"DELETE FROM %@DATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId]; 187 + NSString * sql = [NSString stringWithFormat:@"DELETE FROM %@SDATATABLE where cmsContentId = %d",tableName.uppercaseString,notice.cmsContentId];
188 BOOL res = [db executeUpdate:sql]; 188 BOOL res = [db executeUpdate:sql];
189 if (!res) { 189 if (!res) {
190 return NO; 190 return NO;
@@ -200,7 +200,7 @@ static DBAction *instance = nil; @@ -200,7 +200,7 @@ static DBAction *instance = nil;
200 NSMutableArray *list = [[NSMutableArray alloc] init]; 200 NSMutableArray *list = [[NSMutableArray alloc] init];
201 if ([db open]) { 201 if ([db open]) {
202 tableName = [tableName substringToIndex:2]; 202 tableName = [tableName substringToIndex:2];
203 - NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@DATATABLE",tableName.uppercaseString]; 203 + NSString *sql = [NSString stringWithFormat:@"SELECT * FROM %@SDATATABLE",tableName.uppercaseString];
204 FMResultSet * rs = [db executeQuery:sql]; 204 FMResultSet * rs = [db executeQuery:sql];
205 while ([rs next]) { 205 while ([rs next]) {
206 TableData * notice = [[TableData alloc] init]; 206 TableData * notice = [[TableData alloc] init];
@@ -212,6 +212,7 @@ static DBAction *instance = nil; @@ -212,6 +212,7 @@ static DBAction *instance = nil;
212 notice.gxbArticleId = [rs intForColumn:@"gxbArticleId"]; 212 notice.gxbArticleId = [rs intForColumn:@"gxbArticleId"];
213 notice.gxbVideoId = [rs intForColumn:@"gxbVideoId"]; 213 notice.gxbVideoId = [rs intForColumn:@"gxbVideoId"];
214 notice.img = [rs stringForColumn:@"img"]; 214 notice.img = [rs stringForColumn:@"img"];
  215 + notice.imgSmall = [rs stringForColumn:@"imgSmall"];
215 notice.pageUrl = [rs stringForColumn:@"pageUrl"]; 216 notice.pageUrl = [rs stringForColumn:@"pageUrl"];
216 notice.picType = [rs stringForColumn:@"picType"]; 217 notice.picType = [rs stringForColumn:@"picType"];
217 notice.playType = [rs stringForColumn:@"playType"]; 218 notice.playType = [rs stringForColumn:@"playType"];
@@ -224,6 +225,7 @@ static DBAction *instance = nil; @@ -224,6 +225,7 @@ static DBAction *instance = nil;
224 notice.uploadVideoUrl= [rs stringForColumn:@"uploadVideoUrl"]; 225 notice.uploadVideoUrl= [rs stringForColumn:@"uploadVideoUrl"];
225 notice.videoUrl = [rs stringForColumn:@"videoUrl"]; 226 notice.videoUrl = [rs stringForColumn:@"videoUrl"];
226 notice.vipFlag = [rs intForColumn:@"vipFlag"]; 227 notice.vipFlag = [rs intForColumn:@"vipFlag"];
  228 + notice.author = [rs stringForColumn:@"author"];
227 [list addObject:notice]; 229 [list addObject:notice];
228 } 230 }
229 [db close]; 231 [db close];
CNLiveScioLive/Pages/Tools/DBAction/NoticeData.h
@@ -24,6 +24,7 @@ @@ -24,6 +24,7 @@
24 @property(nonatomic, assign) int gxbArticleId; 24 @property(nonatomic, assign) int gxbArticleId;
25 @property(nonatomic, assign) int gxbVideoId; 25 @property(nonatomic, assign) int gxbVideoId;
26 @property(nonatomic, copy) NSString *img; 26 @property(nonatomic, copy) NSString *img;
  27 +@property(nonatomic, copy) NSString *imgSmall;
27 @property(nonatomic, copy) NSString *pageUrl; 28 @property(nonatomic, copy) NSString *pageUrl;
28 @property(nonatomic, copy) NSString *picType; 29 @property(nonatomic, copy) NSString *picType;
29 @property(nonatomic, copy) NSString *playType; 30 @property(nonatomic, copy) NSString *playType;
CNLiveScioLive/Pages/Tools/DBAction/NoticeData.m
@@ -102,6 +102,11 @@ @@ -102,6 +102,11 @@
102 }else{ 102 }else{
103 self.img = [jsonDic objectForKey:@"img"]; 103 self.img = [jsonDic objectForKey:@"img"];
104 } 104 }
  105 + if ([jsonDic objectForKey:@"imgSmall"] == [NSNull null]) {
  106 + self.imgSmall = @"";
  107 + }else{
  108 + self.imgSmall = [jsonDic objectForKey:@"imgSmall"];
  109 + }
105 if ([jsonDic objectForKey:@"pageUrl"] == [NSNull null]) { 110 if ([jsonDic objectForKey:@"pageUrl"] == [NSNull null]) {
106 self.pageUrl = @""; 111 self.pageUrl = @"";
107 }else{ 112 }else{
@@ -167,11 +172,11 @@ @@ -167,11 +172,11 @@
167 self.uuid = [jsonDic objectForKey:@"uuid"]; 172 self.uuid = [jsonDic objectForKey:@"uuid"];
168 } 173 }
169 174
170 -// if ([jsonDic objectForKey:@"author"] == [NSNull null]) {  
171 -// self.author = @"";  
172 -// }else{  
173 -// self.author = [jsonDic objectForKey:@"author"];  
174 -// } 175 + if ([jsonDic objectForKey:@"author"] == [NSNull null]) {
  176 + self.author = @"";
  177 + }else{
  178 + self.author = [jsonDic objectForKey:@"author"];
  179 + }
175 return self; 180 return self;
176 } 181 }
177 182
@@ -186,6 +191,7 @@ @@ -186,6 +191,7 @@
186 [dic setObject:[NSNumber numberWithInt:self.gxbArticleId] forKey:@"gxbArticleId"]; 191 [dic setObject:[NSNumber numberWithInt:self.gxbArticleId] forKey:@"gxbArticleId"];
187 [dic setObject:[NSNumber numberWithInt:self.gxbVideoId] forKey:@"gxbVideoId"]; 192 [dic setObject:[NSNumber numberWithInt:self.gxbVideoId] forKey:@"gxbVideoId"];
188 [dic setObject:self.img forKey:@"img"]; 193 [dic setObject:self.img forKey:@"img"];
  194 + [dic setObject:self.imgSmall forKey:@"imgSmall"];
189 [dic setObject:self.pageUrl forKey:@"pageUrl"]; 195 [dic setObject:self.pageUrl forKey:@"pageUrl"];
190 [dic setObject:self.picType forKey:@"picType"]; 196 [dic setObject:self.picType forKey:@"picType"];
191 [dic setObject:self.playType?self.playType:@"" forKey:@"playType"]; 197 [dic setObject:self.playType?self.playType:@"" forKey:@"playType"];
@@ -199,7 +205,7 @@ @@ -199,7 +205,7 @@
199 [dic setObject:self.uploadVideoUrl forKey:@"uploadVideoUrl"]; 205 [dic setObject:self.uploadVideoUrl forKey:@"uploadVideoUrl"];
200 [dic setObject:self.videoUrl forKey:@"videoUrl"]; 206 [dic setObject:self.videoUrl forKey:@"videoUrl"];
201 [dic setObject:[NSNumber numberWithInt:self.vipFlag] forKey:@"vipFlag"]; 207 [dic setObject:[NSNumber numberWithInt:self.vipFlag] forKey:@"vipFlag"];
202 -// [dic setObject:self.author forKey:@"author"]; 208 + [dic setObject:self.author forKey:@"author"];
203 return [NSDictionary dictionaryWithDictionary:dic]; 209 return [NSDictionary dictionaryWithDictionary:dic];
204 } 210 }
205 @end 211 @end
CNLiveScioLive/Pages/Tools/ZXVideoPlayer/Classes/ZXVideoPlayerController.m
No preview for this file type