Commit fec9ac1d963eaa32cd4e3e24bf7c4914b2d2ec86

Authored by yanglingyu
1 parent cdc3408e

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

CNLiveScioLive/Pages/Home/新闻详情/OldController/OldVideoDetailViewController.m
... ... @@ -46,8 +46,8 @@
46 46 movieUrl = [NSURL URLWithString:url];
47 47 videoHeight = MainScreenWidth * (9.0 / 16.0);
48 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 51 self->bgImg = [UIImage imageWithData:data];
52 52 dispatch_async(dispatch_get_main_queue(), ^{
53 53 if (self.videoController && self->bgImg) {
... ...
CNLiveScioLive/Pages/Tools/DBAction/DBAction.m
... ... @@ -127,15 +127,15 @@ static DBAction *instance = nil;
127 127 - (void)createTable:(NSString *)tableName{
128 128 if ([db open]) {
129 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 131 BOOL res = [db executeUpdate:sql];
132 132 if (!res) {
133 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 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 139 BOOL result2 = [db executeUpdate:sql2];
140 140  
141 141 } else {
... ... @@ -150,7 +150,7 @@ static DBAction *instance = nil;
150 150 - (BOOL)isInTable:(NSString *)tableName notice:(TableData*)notice{
151 151 if ([db open]) {
152 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 154 FMResultSet * re = [db executeQuery:check];
155 155 while ([re next]) {
156 156 return YES;
... ... @@ -163,12 +163,12 @@ static DBAction *instance = nil;
163 163 - (BOOL)insertTable:(NSString *)tableName notice:(TableData*)notice{
164 164 if ([db open]) {
165 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 167 FMResultSet * re = [db executeQuery:check];
168 168 if (![re next]) {
169 169 NSString *desc = [notice.desc stringByReplacingOccurrencesOfString:@"'" withString:@"''"];
170 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 172 BOOL res = [db executeUpdate:sql];
173 173 if (!res) {
174 174 return NO;
... ... @@ -184,7 +184,7 @@ static DBAction *instance = nil;
184 184 - (BOOL)deleteTable:(NSString *)tableName notice:(TableData*)notice{
185 185 if ([db open]) {
186 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 188 BOOL res = [db executeUpdate:sql];
189 189 if (!res) {
190 190 return NO;
... ... @@ -200,7 +200,7 @@ static DBAction *instance = nil;
200 200 NSMutableArray *list = [[NSMutableArray alloc] init];
201 201 if ([db open]) {
202 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 204 FMResultSet * rs = [db executeQuery:sql];
205 205 while ([rs next]) {
206 206 TableData * notice = [[TableData alloc] init];
... ... @@ -212,6 +212,7 @@ static DBAction *instance = nil;
212 212 notice.gxbArticleId = [rs intForColumn:@"gxbArticleId"];
213 213 notice.gxbVideoId = [rs intForColumn:@"gxbVideoId"];
214 214 notice.img = [rs stringForColumn:@"img"];
  215 + notice.imgSmall = [rs stringForColumn:@"imgSmall"];
215 216 notice.pageUrl = [rs stringForColumn:@"pageUrl"];
216 217 notice.picType = [rs stringForColumn:@"picType"];
217 218 notice.playType = [rs stringForColumn:@"playType"];
... ... @@ -224,6 +225,7 @@ static DBAction *instance = nil;
224 225 notice.uploadVideoUrl= [rs stringForColumn:@"uploadVideoUrl"];
225 226 notice.videoUrl = [rs stringForColumn:@"videoUrl"];
226 227 notice.vipFlag = [rs intForColumn:@"vipFlag"];
  228 + notice.author = [rs stringForColumn:@"author"];
227 229 [list addObject:notice];
228 230 }
229 231 [db close];
... ...
CNLiveScioLive/Pages/Tools/DBAction/NoticeData.h
... ... @@ -24,6 +24,7 @@
24 24 @property(nonatomic, assign) int gxbArticleId;
25 25 @property(nonatomic, assign) int gxbVideoId;
26 26 @property(nonatomic, copy) NSString *img;
  27 +@property(nonatomic, copy) NSString *imgSmall;
27 28 @property(nonatomic, copy) NSString *pageUrl;
28 29 @property(nonatomic, copy) NSString *picType;
29 30 @property(nonatomic, copy) NSString *playType;
... ...
CNLiveScioLive/Pages/Tools/DBAction/NoticeData.m
... ... @@ -102,6 +102,11 @@
102 102 }else{
103 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 110 if ([jsonDic objectForKey:@"pageUrl"] == [NSNull null]) {
106 111 self.pageUrl = @"";
107 112 }else{
... ... @@ -167,11 +172,11 @@
167 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 180 return self;
176 181 }
177 182  
... ... @@ -186,6 +191,7 @@
186 191 [dic setObject:[NSNumber numberWithInt:self.gxbArticleId] forKey:@"gxbArticleId"];
187 192 [dic setObject:[NSNumber numberWithInt:self.gxbVideoId] forKey:@"gxbVideoId"];
188 193 [dic setObject:self.img forKey:@"img"];
  194 + [dic setObject:self.imgSmall forKey:@"imgSmall"];
189 195 [dic setObject:self.pageUrl forKey:@"pageUrl"];
190 196 [dic setObject:self.picType forKey:@"picType"];
191 197 [dic setObject:self.playType?self.playType:@"" forKey:@"playType"];
... ... @@ -199,7 +205,7 @@
199 205 [dic setObject:self.uploadVideoUrl forKey:@"uploadVideoUrl"];
200 206 [dic setObject:self.videoUrl forKey:@"videoUrl"];
201 207 [dic setObject:[NSNumber numberWithInt:self.vipFlag] forKey:@"vipFlag"];
202   -// [dic setObject:self.author forKey:@"author"];
  208 + [dic setObject:self.author forKey:@"author"];
203 209 return [NSDictionary dictionaryWithDictionary:dic];
204 210 }
205 211 @end
... ...
CNLiveScioLive/Pages/Tools/ZXVideoPlayer/Classes/ZXVideoPlayerController.m
No preview for this file type