张国栋 1 hónapja
szülő
commit
e032f77db0

+ 8 - 0
AICityProperty/AICity.xcodeproj/project.pbxproj

@@ -66,6 +66,8 @@
 		93C55BFD2EA8851400AEB59E /* emptyTCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C55BF92EA8851400AEB59E /* emptyTCell.h */; };
 		93C55BFE2EA8851400AEB59E /* emptyTCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93C55BFA2EA8851400AEB59E /* emptyTCell.m */; };
 		93C55C002EA89E5600AEB59E /* JXSuperPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C55BFF2EA89E5600AEB59E /* JXSuperPlayer.h */; };
+		93C55C032EA8D5EE00AEB59E /* VideoDetailCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C55C012EA8D5EE00AEB59E /* VideoDetailCell.h */; };
+		93C55C042EA8D5EE00AEB59E /* VideoDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93C55C022EA8D5EE00AEB59E /* VideoDetailCell.m */; };
 		93CB0FE42EA7A87C00ACFECB /* CommentItemCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 93CB0FE32EA7A87C00ACFECB /* CommentItemCell.xib */; };
 		93CB0FE52EA7A87C00ACFECB /* CommentItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93CB0FE22EA7A87C00ACFECB /* CommentItemCell.m */; };
 		93CB0FE62EA7A87C00ACFECB /* CommentItemCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 93CB0FE12EA7A87C00ACFECB /* CommentItemCell.h */; };
@@ -262,6 +264,8 @@
 		93C55BFA2EA8851400AEB59E /* emptyTCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = emptyTCell.m; sourceTree = "<group>"; };
 		93C55BFB2EA8851400AEB59E /* emptyTCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = emptyTCell.xib; sourceTree = "<group>"; };
 		93C55BFF2EA89E5600AEB59E /* JXSuperPlayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JXSuperPlayer.h; sourceTree = "<group>"; };
+		93C55C012EA8D5EE00AEB59E /* VideoDetailCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VideoDetailCell.h; sourceTree = "<group>"; };
+		93C55C022EA8D5EE00AEB59E /* VideoDetailCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VideoDetailCell.m; sourceTree = "<group>"; };
 		93CB0FE12EA7A87C00ACFECB /* CommentItemCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommentItemCell.h; sourceTree = "<group>"; };
 		93CB0FE22EA7A87C00ACFECB /* CommentItemCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CommentItemCell.m; sourceTree = "<group>"; };
 		93CB0FE32EA7A87C00ACFECB /* CommentItemCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CommentItemCell.xib; sourceTree = "<group>"; };
@@ -505,6 +509,8 @@
 				93C55BF92EA8851400AEB59E /* emptyTCell.h */,
 				93C55BFA2EA8851400AEB59E /* emptyTCell.m */,
 				93C55BFB2EA8851400AEB59E /* emptyTCell.xib */,
+				93C55C012EA8D5EE00AEB59E /* VideoDetailCell.h */,
+				93C55C022EA8D5EE00AEB59E /* VideoDetailCell.m */,
 				93A566D82EA73C7500818C54 /* EXTView */,
 			);
 			path = viewsNew;
@@ -991,6 +997,7 @@
 				93C55BFD2EA8851400AEB59E /* emptyTCell.h in Headers */,
 				93A566DE2EA75F5F00818C54 /* videoItemsNavCell.h in Headers */,
 				93CB0FEC2EA7AE9C00ACFECB /* CommentRpItemCell.h in Headers */,
+				93C55C032EA8D5EE00AEB59E /* VideoDetailCell.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1251,6 +1258,7 @@
 				AC84AB4C2A5968DE00317AFC /* ZFNormalViewController.m in Sources */,
 				AC84AB5B2A5968DE00317AFC /* ZFDouYinCell.m in Sources */,
 				ACB426D32A67F96500C64538 /* AccountCenterViewController.m in Sources */,
+				93C55C042EA8D5EE00AEB59E /* VideoDetailCell.m in Sources */,
 				AC9A8C842A5D4D3B000CC169 /* NetworkingMonitor.m in Sources */,
 				AC84AB532A5968DE00317AFC /* ZFSmallPlayViewController.m in Sources */,
 				93A566D42EA7387800818C54 /* videoItemsCell.m in Sources */,

BIN
AICityProperty/AICity.xcworkspace/xcuserdata/zhangguodong.xcuserdatad/UserInterfaceState.xcuserstate


+ 46 - 0
AICityProperty/AICity.xcworkspace/xcuserdata/zhangguodong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -20,5 +20,51 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "9AC57BF5-D18F-4309-B716-64C1059FC4E9"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "AICity/JuXing/ViewControllers/JXDetailViewController.m"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "412"
+            endingLineNumber = "412"
+            landmarkName = "-pauseAllVideos"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "9AC57BF5-D18F-4309-B716-64C1059FC4E9 - becfb17702c1ec15"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[JXDetailViewController pauseAllVideos]"
+                  moduleName = "AICity"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/zhangguodong/playVideo_ios/AICityProperty/AICity/JuXing/ViewControllers/JXDetailViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "412"
+                  endingLineNumber = "412">
+               </Location>
+               <Location
+                  uuid = "9AC57BF5-D18F-4309-B716-64C1059FC4E9 - becfb17702c1ec15"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "-[JXDetailViewController pauseAllVideos]"
+                  moduleName = "AICity"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/zhangguodong/playVideo_ios/AICityProperty/AICity/JuXing/ViewControllers/JXDetailViewController.m"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "412"
+                  endingLineNumber = "412">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 182 - 177
AICityProperty/AICity/JuXing/ViewControllers/JXDetailViewController.m

@@ -18,7 +18,8 @@
 #import "JXCollectionViewController.h"
 #import "JXCommentViewController.h"
 #import <TXLiteAVSDK_Player/TXLiteAVSDK.h>
-@interface JXDetailViewController () <JXSuperPlayerDelegate, UICollectionViewDelegate, UICollectionViewDataSource,JXCollectionViewControllerDelegate,TXVodPlayListener>{
+#import "VideoDetailCell.h"
+@interface JXDetailViewController () <JXSuperPlayerDelegate, UICollectionViewDelegate, UICollectionViewDataSource,JXCollectionViewControllerDelegate,VideoDetailCellDelegate>{
     JXSuperPlayer *_currentPlayer;
 }
 
@@ -46,6 +47,7 @@
 @property (strong, nonatomic) UISlider *videoSlider;
 @property (nonatomic,assign) BOOL isHuadong;
 @property (strong, nonatomic) NSMutableArray *playerList;
+@property (strong, nonatomic) JXInteraction *pageData;
 @end
 
 @implementation JXDetailViewController
@@ -66,7 +68,6 @@
     
     // 隐藏导航栏返回按钮
     self.navigationItem.hidesBackButton = YES;
-//    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeProgress:) name:@"videoProgressChanged" object:nil];
     [self setupUI];
     [self loadData];
 }
@@ -92,6 +93,7 @@
     
     [self.episodeCollectionView registerClass:[UICollectionViewCell class] 
                      forCellWithReuseIdentifier:@"EpisodeCell"];
+    [self.episodeCollectionView registerClass:[VideoDetailCell class] forCellWithReuseIdentifier:NSStringFromClass(VideoDetailCell.class)];
     
     [self.view addSubview:self.episodeCollectionView];
     
@@ -131,6 +133,9 @@
                 [self.episodeCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:self.playIndex inSection:0]
                                                     atScrollPosition:UICollectionViewScrollPositionCenteredVertically
                                                             animated:NO];
+                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+                    [self playVideoAtIndex:0];
+                });
             } else {
                 NSLog(@"❌ 剧集列表为空,无法播放");
             }
@@ -165,142 +170,114 @@
     return self.episodes.count;
 }
 
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
-    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"EpisodeCell" 
-                                                                           forIndexPath:indexPath];
-    
-    // 清理之前的子视图
-    for (UIView *view in cell.contentView.subviews) {
-        [view removeFromSuperview];
-    }
-    
-    cell.contentView.backgroundColor = [UIColor blackColor];
-    
-    CGFloat width = cell.contentView.bounds.size.width;
-    CGFloat height = cell.contentView.bounds.size.height;
-    
-    // 播放器容器(占据上半部分)
-    CGFloat playerHeight = height;
-    UIView *playerContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, playerHeight)];
-    playerContainer.backgroundColor = [UIColor blackColor];
-    [cell.contentView addSubview:playerContainer];
-    [cell.contentView sendSubviewToBack:playerContainer];
-    // 创建播放器
-    JXSuperPlayer *player = [[JXSuperPlayer alloc] initWithContainerView:playerContainer];
-//    if (self.playerList.count > indexPath.item) {
-//        JXSuperPlayer *sp = self.playerList[indexPath.item];
-//        [sp releasePlayer];
-//        [self.playerList removeObject:sp];
+//- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
+//    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"EpisodeCell" 
+//                                                                           forIndexPath:indexPath];
+//    
+//    // 清理之前的子视图
+//    for (UIView *view in cell.contentView.subviews) {
+//        [view removeFromSuperview];
 //    }
-//    [self.playerList insertObject:player atIndex:indexPath.item];
-    player.delegate = self;
-    // 右侧互动按钮
-    [self setupInteractionButtonsForCell:cell];
-    
-    UILabel * seeL = [[UILabel alloc] initWithFrame:CGRectMake(16, kScreenHeight - 14-safebottom, SCREEN_WIDTH - 32, 14)];
-    seeL.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
-    seeL.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1];
-    [cell.contentView addSubview:seeL];
-    seeL.text = [NSString stringWithFormat:@"%@次播放",@"30万"];
-    
-    
-    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMinY(seeL.frame) - 58, SCREEN_WIDTH, 38)];
-    bottomView.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.1];
-    [cell.contentView addSubview:bottomView];
-    UIImageView *sImgView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 10.5, 17, 17)];
-    sImgView.image = [UIImage imageNamed:@"icon 2.1 拷贝"];
-    [bottomView addSubview:sImgView];
-    UILabel *hjL = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(sImgView.frame)+4, 0, 100, 38)];
-    [bottomView addSubview:hjL];
-    hjL.font = [UIFont boldSystemFontOfSize:18];
-    hjL.textColor = UIColor.whiteColor;
-    hjL.text = @"合集";
-    UIImageView *mImgView = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-27, 13.5, 11, 11)];
-    mImgView.image = [UIImage imageNamed:@"Frame 9366"];
-    [bottomView addSubview:mImgView];
-    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHJ:)];
-    [bottomView addGestureRecognizer:tap];
-    
-    UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(16,34, SCREEN_WIDTH-32, 2)];
-    [bottomView addSubview:slider];
-    slider.maximumValue = 1;
-    slider.minimumValue = 0;
-    [slider setThumbImage:[UIImage imageNamed:@"b_jdt.png"] forState:UIControlStateNormal];
-    [slider setThumbImage:[UIImage imageNamed:@"b_jdtb.png"] forState:UIControlStateHighlighted];
-    [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
-    [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted];
-    [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
-    [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted] ;
-    [slider setMinimumTrackTintColor:COLOR(0, 0, 0, 0.1)];
-    [slider setMaximumTrackTintColor:COLOR(0, 0, 0, 0.1)];
-    slider.alpha = 0.6;
-    self.videoSlider = slider;
-    
-    
-    
-    UILabel *descLabel = [[UILabel alloc] init];
-    descLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
-    descLabel.textColor = [UIColor whiteColor];
-    descLabel.numberOfLines = 2;
-    [cell.contentView addSubview:descLabel];
-    [cell.contentView bringSubviewToFront:descLabel];
-    [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.bottom.equalTo(bottomView.mas_top).offset(-15);
-        make.left.equalTo(cell.contentView).offset(16);
-        make.width.mas_equalTo(SCREEN_WIDTH - 90);
-    }];
-    
-    UILabel *titleLabel = [[UILabel alloc] init];
-    titleLabel.font = [UIFont boldSystemFontOfSize:18];
-    titleLabel.textColor = [UIColor whiteColor];
-    titleLabel.numberOfLines = 2;
-    [cell.contentView addSubview:titleLabel];
-    [cell.contentView bringSubviewToFront:titleLabel];
-    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.bottom.equalTo(descLabel.mas_top).offset(-12.5);
-        make.left.equalTo(cell.contentView).offset(16);
-        make.width.mas_equalTo(SCREEN_WIDTH - 90);
-    }];
-    
- 
-    
-//    // 作者
-//    UILabel *authorLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, y, width - 32, 20)];
-//    authorLabel.font = [UIFont systemFontOfSize:13];
-//    authorLabel.textColor = [UIColor grayColor];
-//    [cell.contentView addSubview:authorLabel];
 //    
-//    [cell.contentView bringSubviewToFront:authorLabel];
-//    y += 30;
-    
-//    // 剧集信息区域
-//    UIView *episodeInfoView = [[UIView alloc] initWithFrame:CGRectMake(0, y, width, height - y)];
-//    episodeInfoView.backgroundColor = [UIColor colorWithWhite:0.1 alpha:1.0];
-//    [cell.contentView addSubview:episodeInfoView];
-    
-    JXEpisode *episode = self.episodes[indexPath.item];
+//    cell.contentView.backgroundColor = [UIColor redColor];
 //    
-//    // 更新标签
-    titleLabel.text = self.drama.title ?: @"";
-    descLabel.text = episode.title ?: @"";
-//    authorLabel.text = [NSString stringWithFormat:@"@%@", self.drama.authorInfo ?: @"未知"];
+//    CGFloat width = cell.contentView.bounds.size.width;
+//    CGFloat height = cell.contentView.bounds.size.height;
 //    
-//    // 剧集编号和标题
-//    UILabel *episodeTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 20, width - 32, 40)];
-//    NSString *episodeTitle = [NSString stringWithFormat:@"第%ld集", (long)episode.episodeNumber];
-//    if (episode.title && episode.title.length > 0) {
-//        episodeTitle = [NSString stringWithFormat:@"%@ - %@", episodeTitle, episode.title];
-//    }
-//    episodeTitleLabel.text = episodeTitle;
-//    episodeTitleLabel.font = [UIFont boldSystemFontOfSize:16];
-//    episodeTitleLabel.textColor = [UIColor whiteColor];
-//    episodeTitleLabel.numberOfLines = 2;
-//    [episodeInfoView addSubview:episodeTitleLabel];
+//    // 播放器容器(占据上半部分)
+//    CGFloat playerHeight = height;
+//    UIView *playerContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, playerHeight)];
+//    playerContainer.backgroundColor = [UIColor blackColor];
+//    [cell.contentView addSubview:playerContainer];
+//    [cell.contentView sendSubviewToBack:playerContainer];
+//    // 创建播放器
+//    JXSuperPlayer *player = [[JXSuperPlayer alloc] initWithContainerView:playerContainer];
+//    player.delegate = self;
+//    // 右侧互动按钮
+//    [self setupInteractionButtonsForCell:cell];
+//    
+//    UILabel * seeL = [[UILabel alloc] initWithFrame:CGRectMake(16, kScreenHeight - 14-safebottom, SCREEN_WIDTH - 32, 14)];
+//    seeL.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
+//    seeL.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1];
+//    [cell.contentView addSubview:seeL];
+//    seeL.text = [NSString stringWithFormat:@"%@次播放",@"30万"];
+//    
+//    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMinY(seeL.frame) - 58, SCREEN_WIDTH, 38)];
+//    bottomView.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.1];
+//    [cell.contentView addSubview:bottomView];
+//    UIImageView *sImgView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 10.5, 17, 17)];
+//    sImgView.image = [UIImage imageNamed:@"icon 2.1 拷贝"];
+//    [bottomView addSubview:sImgView];
+//    UILabel *hjL = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(sImgView.frame)+4, 0, 100, 38)];
+//    [bottomView addSubview:hjL];
+//    hjL.font = [UIFont boldSystemFontOfSize:18];
+//    hjL.textColor = UIColor.whiteColor;
+//    hjL.text = @"合集";
+//    UIImageView *mImgView = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-27, 13.5, 11, 11)];
+//    mImgView.image = [UIImage imageNamed:@"Frame 9366"];
+//    [bottomView addSubview:mImgView];
+//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHJ:)];
+//    [bottomView addGestureRecognizer:tap];
+//    
+//    UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(16,34, SCREEN_WIDTH-32, 2)];
+//    [bottomView addSubview:slider];
+//    slider.maximumValue = 1;
+//    slider.minimumValue = 0;
+//    [slider setThumbImage:[UIImage imageNamed:@"b_jdt.png"] forState:UIControlStateNormal];
+//    [slider setThumbImage:[UIImage imageNamed:@"b_jdtb.png"] forState:UIControlStateHighlighted];
+//    [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
+//    [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted];
+//    [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
+//    [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted] ;
+//    [slider setMinimumTrackTintColor:COLOR(0, 0, 0, 0.1)];
+//    [slider setMaximumTrackTintColor:COLOR(0, 0, 0, 0.1)];
+//    slider.alpha = 0.6;
+//    self.videoSlider = slider;
+//    
+//    UILabel *descLabel = [[UILabel alloc] init];
+//    descLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
+//    descLabel.textColor = [UIColor whiteColor];
+//    descLabel.numberOfLines = 2;
+//    [cell.contentView addSubview:descLabel];
+//    [cell.contentView bringSubviewToFront:descLabel];
+//    [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.bottom.equalTo(bottomView.mas_top).offset(-15);
+//        make.left.equalTo(cell.contentView).offset(16);
+//        make.width.mas_equalTo(SCREEN_WIDTH - 90);
+//    }];
+//    
+//    UILabel *titleLabel = [[UILabel alloc] init];
+//    titleLabel.font = [UIFont boldSystemFontOfSize:18];
+//    titleLabel.textColor = [UIColor whiteColor];
+//    titleLabel.numberOfLines = 2;
+//    [cell.contentView addSubview:titleLabel];
+//    [cell.contentView bringSubviewToFront:titleLabel];
+//    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.bottom.equalTo(descLabel.mas_top).offset(-12.5);
+//        make.left.equalTo(cell.contentView).offset(16);
+//        make.width.mas_equalTo(SCREEN_WIDTH - 90);
+//    }];
+//    
+//    JXEpisode *episode = self.episodes[indexPath.item];
+//    titleLabel.text = self.drama.title ?: @"";
+//    descLabel.text = episode.title ?: @"";
+//    
+//    // 播放视频
+//    [player playWithAppId:episode.appId fileId:episode.fileId psign:episode.psign];
+//    
+//    return cell;
+//}
+
+-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
     
-  
-    // 播放视频
-    [player playWithAppId:episode.appId fileId:episode.fileId psign:episode.psign];
+    VideoDetailCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass(VideoDetailCell.class) forIndexPath:indexPath];
+    // 设置代理
+    cell.delegate = self;
+    NSLog(@"[JXShortDrama] ✅ cellForItemAtIndexPath - Cell delegate 已设置,index: %ld", (long)indexPath.item);
     
+    // 配置数据
+    JXEpisode *episode = self.episodes[indexPath.item];
+    [cell configureWithDrama:episode andDiction:self.interaction andTitle:self.drama.title];
     return cell;
 }
 - (void)showHJ:(UIGestureRecognizer *)gtr{
@@ -338,26 +315,30 @@
         NSLog(@"[JXShortDrama] 🗨️ commentVC present 完成!");
     }];
 }
+- (void)shortDramaCellDidTapComment:(UICollectionViewCell *)cell {
+    [self commentDidClicked];
+}
+- (void)shortDramaCellDidTapCollection:(UICollectionViewCell *)cell {
+    JXCollectionViewController *collectionVC = [[JXCollectionViewController alloc] initWithDramaId:self.dramaId];
+    collectionVC.delegate = self;
+    // 设置弹窗样式(底部弹出)
+    if (@available(iOS 15.0, *)) {
+        UISheetPresentationController *sheet = collectionVC.sheetPresentationController;
+        sheet.detents = @[
+            [UISheetPresentationControllerDetent mediumDetent],
+            [UISheetPresentationControllerDetent largeDetent]
+        ];
+        sheet.prefersGrabberVisible = YES;
+    }
+    
+    [self presentViewController:collectionVC animated:YES completion:nil];
+}
 - (void)superPlayerDidUpdateProgress:(NSTimeInterval)currentTime duration:(NSTimeInterval)duration {
     // 播放进度更新(可用于显示进度条)
     // NSLog(@"[JXShortDramaCell] 播放进度: %.1f / %.1f", currentTime, duration);
     float progress = currentTime/duration;
     self.videoSlider.value = progress;
 }
-//- (void)changeProgress:(NSNotification *)niti{
-//    if (!self.isHuadong){
-//        NSDictionary *user = niti.userInfo;
-//        JXEpisode *episode = self.episodes[self.currentEpisodeIndex];
-//
-//        if ([user[@"fileId"] isEqualToString:episode.fileId] ) {
-//            float progress = [user[@"progress"] floatValue];
-//            self.videoSlider.value = progress;
-//            NSLog(@"进度--%f",progress);
-//        }
-//        
-//    }
-//    
-//}
 
 - (void)collectionViewControllerDidSelectEpisode:(NSString *)episodeId {
     NSLog(@"[JXShortDrama] 选择播放剧集: %@", episodeId);
@@ -367,15 +348,7 @@
 }
 #pragma mark - UICollectionViewDelegate
 
-- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
-    // 停止不可见的播放器
-    NSLog(@"消失的cell----%d",indexPath.item);
-//    JXSuperPlayer *player = [self.playerList objectAtIndex:indexPath.item];
-//    [player pause];
-}
-//- (void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
-//    NSLog(@"出现的cell----%d",indexPath.item);
-//}
+
 - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
     // 获取当前可见的cell索引
     CGFloat pageWidth = scrollView.frame.size.width;
@@ -383,32 +356,64 @@
     NSInteger currentPage = (NSInteger)(scrollView.contentOffset.y / pageHeight);
     
     if (currentPage != self.currentEpisodeIndex) {
+        [self stopVideoAtIndex:self.currentEpisodeIndex];
+        // 播放新视频
         self.currentEpisodeIndex = currentPage;
-        NSLog(@"📺 滚动到第 %ld 集", (long)currentPage + 1);
-        
-//        UICollectionViewCell *cell = [self.episodeCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:currentPage inSection:0]];
-//        // 创建播放器
-//        CGFloat width = cell.contentView.bounds.size.width;
-//        CGFloat height = cell.contentView.bounds.size.height;
-//        CGFloat playerHeight = height;
-//        UIView *playerContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, playerHeight)];
-//        playerContainer.backgroundColor = [UIColor blackColor];
-//        [cell.contentView addSubview:playerContainer];
-//        [cell.contentView sendSubviewToBack:playerContainer];
-//        JXEpisode *episode = self.episodes[currentPage];
-//        JXSuperPlayer *player = [[JXSuperPlayer alloc] initWithContainerView:playerContainer];
-//        player.delegate = self;
-//        if (_currentPlayer) {
-//            [_currentPlayer releasePlayer];
-//        }
-//        _currentPlayer = player;
-//        // 播放视频
-//        [player playWithAppId:episode.appId fileId:episode.fileId psign:episode.psign];
-        
-        
+        [self playVideoAtIndex:currentPage];
+    }else{
+        [self resumeCurrentVideo];
     }
+    
 }
+- (void)playVideoAtIndex:(NSInteger)index {
+
+    if (index < 0 || index >= self.episodes.count) {
+        return;
+    }
 
+    
+    [self doPlayVideoAtIndex:index];
+}
+- (void)doPlayVideoAtIndex:(NSInteger)index {
+    // 启动播放
+    VideoDetailCell *cell = (VideoDetailCell *)[self.episodeCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0]];
+    if (cell) {
+        [cell startPlay];
+    }
+}
+- (void)stopVideoAtIndex:(NSInteger)index {
+    if (index < 0 || index >= self.episodes.count) {
+        return;
+    }
+    VideoDetailCell *cell = (VideoDetailCell *)[self.episodeCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:index inSection:0]];
+    [cell stopPlay];
+}
+
+- (void)pauseCurrentVideo {
+    if (self.currentEpisodeIndex < 0 || self.currentEpisodeIndex >= self.episodes.count) {
+        return;
+    }
+
+    VideoDetailCell *cell = (VideoDetailCell *)[self.episodeCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:self.currentEpisodeIndex inSection:0]];
+    [cell pausePlay];
+}
+
+- (void)resumeCurrentVideo {
+    if (self.currentEpisodeIndex < 0 || self.currentEpisodeIndex >= self.episodes.count) {
+        return;
+    }
+
+    VideoDetailCell *cell = (VideoDetailCell *)[self.episodeCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:self.currentEpisodeIndex inSection:0]];
+    [cell resumePlay];
+}
+
+- (void)pauseAllVideos {
+    // 暂停所有可见的Cell
+    for (NSIndexPath *indexPath in self.episodeCollectionView.indexPathsForVisibleItems) {
+        VideoDetailCell *cell = (VideoDetailCell *)[self.episodeCollectionView cellForItemAtIndexPath:indexPath];
+        [cell pausePlay];
+    }
+}
 #pragma mark - Helper Methods
 
 - (void)setupInteractionButtonsForCell:(UICollectionViewCell *)cell {

+ 82 - 0
AICityProperty/viewsNew/VideoDetailCell.h

@@ -0,0 +1,82 @@
+//
+//  VideoDetailCell.h
+//  AICity
+//
+//  Created by 张国栋 on 2025/10/22.
+//  Copyright © 2025 wei.z. All rights reserved.
+//
+
+
+#import <UIKit/UIKit.h>
+@class JXEpisode;
+#import "JXSuperPlayer.h"
+#import "JXInteraction.h"
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ * 短剧播放Cell回调协议
+ */
+@protocol VideoDetailCellDelegate <NSObject>
+
+@optional
+- (void)shortDramaCellDidTapLike:(UICollectionViewCell *)cell;
+- (void)shortDramaCellDidTapFavorite:(UICollectionViewCell *)cell;
+- (void)shortDramaCellDidTapComment:(UICollectionViewCell *)cell;
+- (void)shortDramaCellDidTapCollection:(UICollectionViewCell *)cell;
+- (void)shortDramaCellDidTapDetail:(UICollectionViewCell *)cell;
+- (void)shortDramaCellDidFailToPlay:(UICollectionViewCell *)cell;
+
+@end
+
+/**
+ * 短剧垂直滑动播放Cell
+ *
+ * 功能:
+ * - 集成SuperPlayer播放DRM视频
+ * - 显示交互按钮(点赞、收藏、评论、合集)
+ * - 显示短剧信息(标题、描述、作者)
+ * - 支持手势交互
+ *
+ * 对标Android: ShortDramaSuperPlayerAdapter.SuperPlayerViewHolder
+ */
+@interface VideoDetailCell : UICollectionViewCell
+
+@property (nonatomic, weak) id<VideoDetailCellDelegate> delegate;
+@property (nonatomic, assign, readonly) JXSuperPlayerState playerState;
+
+/**
+ * 配置Cell数据
+ */
+- (void)configureWithDrama:(JXEpisode *)drama andDiction:(JXInteraction *)model andTitle:(NSString *)title;
+
+/**
+ * 播放控制
+ */
+- (void)startPlay;
+- (void)stopPlay;
+- (void)pausePlay;
+- (void)resumePlay;
+
+/**
+ * 更新交互UI
+ */
+- (void)updateLikeUI:(BOOL)isLiked count:(long long)count;
+- (void)updateFavoriteUI:(BOOL)isFavorited count:(long long)count;
+- (void)updateCommentCount:(long long)count;
+
+/**
+ * 更新点赞和收藏数量(与ViewController匹配)
+ */
+- (void)updateLikeCount:(NSInteger)likeCount isLiked:(BOOL)isLiked;
+- (void)updateFavoriteCount:(NSInteger)favoriteCount isFavorited:(BOOL)isFavorited;
+
+/**
+ * 格式化数字显示(如 1000 -> 1K)
+ */
++ (NSString *)formattedCountWithCount:(long long)count;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+

+ 644 - 0
AICityProperty/viewsNew/VideoDetailCell.m

@@ -0,0 +1,644 @@
+//
+//  VideoDetailCell.m
+//  AICity
+//
+//  Created by 张国栋 on 2025/10/22.
+//  Copyright © 2025 wei.z. All rights reserved.
+//
+
+
+#import "VideoDetailCell.h"
+#import "JXSuperPlayer.h"
+#import "JXDramaContent.h"
+#import "JXInteraction.h"
+#import "GuestHelper.h"
+#import "JXEpisode.h"
+@interface VideoDetailCell () <JXSuperPlayerDelegate>
+
+#pragma mark - UI组件
+// 播放器容器
+@property (nonatomic, strong) UIView *playerContainerView;
+
+// 右侧交互按钮组
+@property (nonatomic, strong) UIButton *likeButton;
+@property (nonatomic, strong) UILabel *likeCountLabel;
+@property (nonatomic, strong) UIButton *favoriteButton;
+@property (nonatomic, strong) UILabel *favoriteCountLabel;
+@property (nonatomic, strong) UIButton *commentButton;
+@property (nonatomic, strong) UILabel *commentCountLabel;
+@property (nonatomic, strong) UIButton *collectionButton;
+
+// 底部信息区
+@property (nonatomic, strong) UIView *bottomInfoView;
+@property (nonatomic, strong) UILabel *titleLabel;
+@property (nonatomic, strong) UILabel *descriptionLabel;
+
+#pragma mark - 数据 JXEpisode
+@property (nonatomic, strong) JXEpisode *drama;
+
+#pragma mark - 播放器
+@property (nonatomic, strong) JXSuperPlayer *superPlayer;
+@property (nonatomic, assign) JXSuperPlayerState playerState; // 播放器状态
+
+// 播放超时检测
+@property (nonatomic, strong) NSTimer *playTimeoutTimer; // 播放超时检测定时器
+@property (nonatomic, strong) NSDate *playStartTime; // 播放开始时间
+@property (strong, nonatomic) UISlider *videoSlider;
+
+@end
+
+@implementation VideoDetailCell
+
+#pragma mark - 初始化
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    self = [super initWithFrame:frame];
+    if (self) {
+        [self setupUI];
+    }
+    return self;
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    
+    NSLog(@"[JXShortDramaCell] prepareForReuse - 停止当前播放");
+    
+    // 只停止播放,不释放播放器实例
+    // 重用播放器实例可以避免频繁创建销毁导致的连接问题
+    [self stopPlay];
+    
+    // 停止超时检测
+    [self stopPlayTimeoutTimer];
+}
+
+#pragma mark - UI设置
+
+- (void)setupUI {
+    self.contentView.backgroundColor = [UIColor blackColor];
+    
+    // 创建播放器容器
+    [self setupPlayerContainer];
+    
+    // 创建交互按钮组
+    [self setupInteractionButtons];
+    
+    // 创建底部信息区
+    [self setupBottomInfo];
+    
+    
+    
+}
+
+- (void)setupPlayerContainer {
+    self.playerContainerView = [[UIView alloc] init];
+    self.playerContainerView.backgroundColor = [UIColor blackColor];
+    [self.contentView addSubview:self.playerContainerView];
+    
+    // 约束 - 播放器下边界贴近底部导航栏(44pt高)
+    self.playerContainerView.translatesAutoresizingMaskIntoConstraints = NO;
+    [NSLayoutConstraint activateConstraints:@[
+        [self.playerContainerView.topAnchor constraintEqualToAnchor:self.contentView.topAnchor],
+        [self.playerContainerView.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor],
+        [self.playerContainerView.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor],
+        [self.playerContainerView.bottomAnchor constraintEqualToAnchor:self.contentView.bottomAnchor constant:-44]
+    ]];
+}
+
+- (void)setupInteractionButtons {
+//    // 点赞按钮
+//    [self addLikeButton];
+//    
+//    // 收藏按钮
+//    [self addFavoriteButton];
+//    
+//    // 评论按钮
+//    [self addCommentButton];
+//    
+//    // 合集按钮
+//    [self addCollectionButton];
+    
+    CGFloat width = self.contentView.bounds.size.width;
+    UIView *container = [[UIView alloc] initWithFrame:CGRectMake(width - 48, kScreenHeight - safebottom - 190 - 90, 32, 190)];
+    [self.contentView addSubview:container];
+    
+    
+    // 点赞
+    UIButton *likeButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    likeButton.frame = CGRectMake(0, 0, 32, 32);
+    [likeButton setImage:[UIImage imageNamed:@"icon 1.1"] forState:UIControlStateNormal];
+    [likeButton setImage:[UIImage imageNamed:@"icon 1.5"] forState:UIControlStateSelected];
+    [container addSubview:likeButton];
+    
+    UILabel *likeCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, 32, 18)];
+    likeCountLabel.textAlignment = NSTextAlignmentCenter;
+    likeCountLabel.font = [UIFont systemFontOfSize:12];
+    likeCountLabel.textColor = [UIColor whiteColor];
+//    likeCountLabel.text = [self formatCount:self.interaction.likeCount];
+    [container addSubview:likeCountLabel];
+    self.likeButton = likeButton;
+    self.likeCountLabel = likeCountLabel;
+    
+    // 收藏
+    UIButton *favoriteButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    favoriteButton.frame = CGRectMake(0, CGRectGetMaxY(likeCountLabel.frame) + 20, 32, 32);
+    [favoriteButton setImage:[UIImage imageNamed:@"icon 1.2"] forState:UIControlStateNormal];
+    [favoriteButton setImage:[UIImage imageNamed:@"icon 1.5"] forState:UIControlStateSelected];
+    [container addSubview:favoriteButton];
+    
+    UILabel *favoriteCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(favoriteButton.frame), 32, 18)];
+    favoriteCountLabel.textAlignment = NSTextAlignmentCenter;
+    favoriteCountLabel.font = [UIFont systemFontOfSize:12];
+    favoriteCountLabel.textColor = [UIColor whiteColor];
+//    favoriteCountLabel.text = [self formatCount:self.interaction.favoriteCount];
+    [container addSubview:favoriteCountLabel];
+    self.favoriteButton = favoriteButton;
+    self.favoriteCountLabel = favoriteCountLabel;
+    
+    // 评论
+    UIButton *commentButton = [UIButton buttonWithType:UIButtonTypeCustom];
+    commentButton.frame = CGRectMake(0, CGRectGetMaxY(favoriteCountLabel.frame) + 20, 32, 32);
+    [commentButton setImage:[UIImage imageNamed:@"icon 1.3"] forState:UIControlStateNormal];
+    [container addSubview:commentButton];
+    [commentButton addTarget:self action:@selector(handleCommentTap) forControlEvents:UIControlEventTouchUpInside];
+    UILabel *commentCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(commentButton.frame) , 32, 18)];
+    commentCountLabel.textAlignment = NSTextAlignmentCenter;
+    commentCountLabel.font = [UIFont systemFontOfSize:12];
+    commentCountLabel.textColor = [UIColor whiteColor];
+//    commentCountLabel.text = [self formatCount:self.interaction.commentCount];
+    [container addSubview:commentCountLabel];
+    self.commentCountLabel = commentCountLabel;
+}
+
+//- (void)addLikeButton {
+//   
+//    UIView *likeContainer = [[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width-48, self.frame.size.height-BAR_HEIGHT - 100 - 130, 32, 50)];
+//    self.likeButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 32, 32)];
+//    [self.likeButton setImage:[UIImage imageNamed:@"icon 1.1"] forState:UIControlStateNormal];
+//    [self.likeButton setImage:[UIImage imageNamed:@"icon 1.5"] forState:UIControlStateSelected];
+//    self.likeButton.tintColor = [UIColor whiteColor];
+//    [self.likeButton addTarget:self action:@selector(handleLikeTap) forControlEvents:UIControlEventTouchUpInside];
+//    [likeContainer addSubview:self.likeButton];
+//    self.likeCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 32, 32, 18)];
+//    self.likeCountLabel.textColor = [UIColor whiteColor];
+//    self.likeCountLabel.font = [UIFont systemFontOfSize:12];
+//    self.likeCountLabel.textAlignment = NSTextAlignmentCenter;
+//    self.likeCountLabel.text = @"0";
+//    [likeContainer addSubview:self.likeCountLabel];
+//    [self.contentView addSubview:likeContainer];
+//}
+//
+//- (void)addFavoriteButton {
+//   
+//    UIView *favoriteContainer = [[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width-48, self.frame.size.height-BAR_HEIGHT - 100 - 65, 32, 50)];
+//    self.favoriteButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 32, 32)];
+//    [self.favoriteButton setImage:[UIImage imageNamed:@"icon 1.2"] forState:UIControlStateNormal];
+//    [self.favoriteButton setImage:[UIImage imageNamed:@"icon 1.5"] forState:UIControlStateSelected];
+//    self.favoriteButton.tintColor = [UIColor whiteColor];
+//    [self.favoriteButton addTarget:self action:@selector(handleFavoriteTap) forControlEvents:UIControlEventTouchUpInside];
+//    [favoriteContainer addSubview:self.favoriteButton];
+//    self.favoriteCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 32, 32, 18)];
+//    self.favoriteCountLabel.textColor = [UIColor whiteColor];
+//    self.favoriteCountLabel.font = [UIFont systemFontOfSize:12];
+//    self.favoriteCountLabel.textAlignment = NSTextAlignmentCenter;
+//    self.favoriteCountLabel.text = @"0";
+//    [favoriteContainer addSubview:self.favoriteCountLabel];
+//    [self.contentView addSubview:favoriteContainer];
+//}
+//
+//- (void)addCommentButton {
+//    UIView *commentContainer = [[UIView alloc] initWithFrame:CGRectMake(self.frame.size.width-48, self.frame.size.height-BAR_HEIGHT - 100, 32, 50)];
+//    self.commentButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 32, 32)];
+//    [self.commentButton setImage:[UIImage imageNamed:@"icon 1.3"] forState:UIControlStateNormal];
+//    self.commentButton.tintColor = [UIColor whiteColor];
+//    [self.commentButton addTarget:self action:@selector(handleCommentTap) forControlEvents:UIControlEventTouchUpInside];
+//    [commentContainer addSubview:self.commentButton];
+//    self.commentCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 32, 32, 18)];
+//    self.commentCountLabel.textColor = [UIColor whiteColor];
+//    self.commentCountLabel.font = [UIFont systemFontOfSize:12];
+//    self.commentCountLabel.textAlignment = NSTextAlignmentCenter;
+//    self.commentCountLabel.text = @"0";
+//    [commentContainer addSubview:self.commentCountLabel];
+//    [self.contentView addSubview:commentContainer];
+//}
+//
+//- (void)addCollectionButton {
+//    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.frame.size.height - 38 - BAR_HEIGHT, SCREEN_WIDTH, 38)];
+//    bottomView.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.1];
+//    [self.contentView addSubview:bottomView];
+//    UIImageView *sImgView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 10.5, 17, 17)];
+//    sImgView.image = [UIImage imageNamed:@"icon 2.1 拷贝"];
+//    [bottomView addSubview:sImgView];
+//    UILabel *hjL = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(sImgView.frame)+4, 0, 100, 38)];
+//    [bottomView addSubview:hjL];
+//    hjL.font = [UIFont boldSystemFontOfSize:18];
+//    hjL.textColor = UIColor.whiteColor;
+//    hjL.text = @"合集";
+//    UIImageView *mImgView = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-27, 13.5, 11, 11)];
+//    mImgView.image = [UIImage imageNamed:@"Frame 9366"];
+//    [bottomView addSubview:mImgView];
+//    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCollectionTap)];
+//    [bottomView addGestureRecognizer:tap];
+//    
+//}
+
+- (void)setupBottomInfo {
+    
+        self.contentView.backgroundColor = [UIColor redColor];
+    
+        CGFloat width = self.contentView.bounds.size.width;
+        CGFloat height = self.contentView.bounds.size.height;
+    
+        // 播放器容器(占据上半部分)
+        CGFloat playerHeight = height;
+        UIView *playerContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, playerHeight)];
+        playerContainer.backgroundColor = [UIColor blackColor];
+        [self.contentView addSubview:playerContainer];
+        [self.contentView sendSubviewToBack:playerContainer];
+        // 创建播放器
+        JXSuperPlayer *player = [[JXSuperPlayer alloc] initWithContainerView:playerContainer];
+        player.delegate = self;
+        // 右侧互动按钮
+       
+    
+        UILabel * seeL = [[UILabel alloc] initWithFrame:CGRectMake(16, kScreenHeight - 14-safebottom, SCREEN_WIDTH - 32, 14)];
+        seeL.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
+        seeL.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1];
+        [self.contentView addSubview:seeL];
+        seeL.text = [NSString stringWithFormat:@"%@次播放",@"30万"];
+    
+        UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMinY(seeL.frame) - 58, SCREEN_WIDTH, 38)];
+        bottomView.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:0.1];
+        [self.contentView addSubview:bottomView];
+        UIImageView *sImgView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 10.5, 17, 17)];
+        sImgView.image = [UIImage imageNamed:@"icon 2.1 拷贝"];
+        [bottomView addSubview:sImgView];
+        UILabel *hjL = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(sImgView.frame)+4, 0, 100, 38)];
+        [bottomView addSubview:hjL];
+        hjL.font = [UIFont boldSystemFontOfSize:18];
+        hjL.textColor = UIColor.whiteColor;
+        hjL.text = @"合集";
+        UIImageView *mImgView = [[UIImageView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-27, 13.5, 11, 11)];
+        mImgView.image = [UIImage imageNamed:@"Frame 9366"];
+        [bottomView addSubview:mImgView];
+        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCollectionTap)];
+        [bottomView addGestureRecognizer:tap];
+    
+        UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(16,34, SCREEN_WIDTH-32, 2)];
+        [bottomView addSubview:slider];
+        slider.maximumValue = 1;
+        slider.minimumValue = 0;
+        [slider setThumbImage:[UIImage imageNamed:@"b_jdt.png"] forState:UIControlStateNormal];
+        [slider setThumbImage:[UIImage imageNamed:@"b_jdtb.png"] forState:UIControlStateHighlighted];
+        [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
+        [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted];
+        [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
+        [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted] ;
+        [slider setMinimumTrackTintColor:COLOR(0, 0, 0, 0.1)];
+        [slider setMaximumTrackTintColor:COLOR(0, 0, 0, 0.1)];
+        slider.alpha = 0.6;
+        self.videoSlider = slider;
+    
+        UILabel *descLabel = [[UILabel alloc] init];
+        descLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
+        descLabel.textColor = [UIColor whiteColor];
+        descLabel.numberOfLines = 2;
+        [self.contentView addSubview:descLabel];
+        [self.contentView bringSubviewToFront:descLabel];
+        [descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.bottom.equalTo(bottomView.mas_top).offset(-15);
+            make.left.equalTo(self.contentView).offset(16);
+            make.width.mas_equalTo(SCREEN_WIDTH - 90);
+        }];
+        self.descriptionLabel = descLabel;
+        UILabel *titleLabel = [[UILabel alloc] init];
+        titleLabel.font = [UIFont boldSystemFontOfSize:18];
+        titleLabel.textColor = [UIColor whiteColor];
+        titleLabel.numberOfLines = 2;
+        [self.contentView addSubview:titleLabel];
+        [self.contentView bringSubviewToFront:titleLabel];
+        [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.bottom.equalTo(descLabel.mas_top).offset(-12.5);
+            make.left.equalTo(self.contentView).offset(16);
+            make.width.mas_equalTo(SCREEN_WIDTH - 90);
+        }];
+        self.titleLabel = titleLabel;
+    
+//    self.bottomInfoView = [[UIView alloc] init];
+//    [self.contentView addSubview:self.bottomInfoView];
+//    
+//    // 标题
+//    self.titleLabel = [[UILabel alloc] init];
+//    self.titleLabel.textColor = [UIColor whiteColor];
+//    self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
+//    self.titleLabel.numberOfLines = 2;
+//    [self.bottomInfoView addSubview:self.titleLabel];
+//    
+//    // 描述
+//    self.descriptionLabel = [[UILabel alloc] init];
+//    self.descriptionLabel.textColor = [UIColor colorWithWhite:1.0 alpha:1];
+//    self.descriptionLabel.font = [UIFont systemFontOfSize:15];
+//    self.descriptionLabel.numberOfLines = 2;
+//    [self.bottomInfoView addSubview:self.descriptionLabel];
+//    
+//    // 约束
+//    self.bottomInfoView.translatesAutoresizingMaskIntoConstraints = NO;
+//    self.titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
+//    self.descriptionLabel.translatesAutoresizingMaskIntoConstraints = NO;
+//    
+//    [NSLayoutConstraint activateConstraints:@[
+//        [self.bottomInfoView.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor],
+//        [self.bottomInfoView.trailingAnchor constraintEqualToAnchor:self.contentView.trailingAnchor constant:-90],
+//        [self.bottomInfoView.bottomAnchor constraintEqualToAnchor:self.contentView.safeAreaLayoutGuide.bottomAnchor constant:-(BAR_HEIGHT+54)],
+//        [self.bottomInfoView.heightAnchor constraintGreaterThanOrEqualToConstant:80],
+//        
+//        [self.titleLabel.topAnchor constraintEqualToAnchor:self.bottomInfoView.topAnchor constant:12],
+//        [self.titleLabel.leadingAnchor constraintEqualToAnchor:self.bottomInfoView.leadingAnchor constant:16],
+//        [self.titleLabel.trailingAnchor constraintEqualToAnchor:self.bottomInfoView.trailingAnchor constant:-16],
+//        
+//        [self.descriptionLabel.topAnchor constraintEqualToAnchor:self.titleLabel.bottomAnchor constant:8],
+//        [self.descriptionLabel.leadingAnchor constraintEqualToAnchor:self.bottomInfoView.leadingAnchor constant:16],
+//        [self.descriptionLabel.trailingAnchor constraintEqualToAnchor:self.bottomInfoView.trailingAnchor constant:-16],
+//        
+//    ]];
+}
+
+#pragma mark - 公开方法
+
+- (void)configureWithDrama:(JXEpisode *)drama andDiction:(JXInteraction *)model andTitle:(NSString *)title{
+    self.drama = drama;
+    
+    // 更新UI
+    self.titleLabel.text = title ?: @"未知标题";
+    self.descriptionLabel.text = drama.title ?: @"暂无描述";
+    
+    // 更新交互数据
+    [self updateLikeUI:model.isLiked count:model.likeCount];
+    [self updateFavoriteUI:model.isFavorited count:model.favoriteCount];
+    [self updateCommentCount:model.commentCount];
+}
+- (NSString *)formatCount:(long long)count {
+    if (count >= 1000000) {
+        return [NSString stringWithFormat:@"%.1fM", count / 1000000.0];
+    } else if (count >= 1000) {
+        return [NSString stringWithFormat:@"%.1fK", count / 1000.0];
+    }
+    return [NSString stringWithFormat:@"%lld", count];
+}
+- (void)startPlay {
+    if (!self.drama) {
+        return;
+    }
+    
+    // 创建播放器(如果不存在)
+    if (!self.superPlayer) {
+        self.superPlayer = [[JXSuperPlayer alloc] initWithContainerView:self.playerContainerView];
+        self.superPlayer.delegate = self;
+    } else {
+        NSLog(@"[JXShortDramaCell] 重用现有播放器实例");
+    }
+        // FileID + psign播放(DRM推荐)
+        NSString *appId = self.drama.appId;
+        // 如果没有appId,尝试从psign中提取
+        if (!appId || appId.length == 0) {
+            appId = [JXSuperPlayer extractAppIdFromPsign:self.drama.psign];
+        }
+        
+        if (!appId) {
+            return;
+        }
+        
+        
+    [self.superPlayer playWithAppId:appId
+                                 fileId:self.drama.fileId
+                                  psign:self.drama.psign];
+        
+  
+}
+
+- (void)stopPlay {
+    if (self.superPlayer) {
+        [self.superPlayer stop];
+        NSLog(@"[JXShortDramaCell] 播放器已停止");
+    }
+}
+
+- (void)pausePlay {
+    if (self.superPlayer) {
+        [self.superPlayer pause];
+    }
+}
+
+- (void)resumePlay {
+    if (self.superPlayer) {
+        [self.superPlayer resume];
+    }
+}
+
+- (void)updateLikeUI:(BOOL)isLiked count:(long long)count {
+    self.likeButton.selected = isLiked;
+    self.likeButton.tintColor = isLiked ? [UIColor systemPinkColor] : [UIColor whiteColor];
+    self.likeCountLabel.text = [VideoDetailCell formattedCountWithCount:count];
+}
+
+- (void)updateFavoriteUI:(BOOL)isFavorited count:(long long)count {
+    self.favoriteButton.selected = isFavorited;
+    self.favoriteButton.tintColor = isFavorited ? [UIColor systemYellowColor] : [UIColor whiteColor];
+    self.favoriteCountLabel.text = [VideoDetailCell formattedCountWithCount:count];
+}
+
+- (void)updateCommentCount:(long long)count {
+    self.commentCountLabel.text = [VideoDetailCell formattedCountWithCount:count];
+}
+
+/**
+ * 格式化数字显示(如 1000 -> 1K)
+ */
++ (NSString *)formattedCountWithCount:(long long)count {
+    if (count >= 1000000) {
+        return [NSString stringWithFormat:@"%.1fM", count / 1000000.0];
+    } else if (count >= 1000) {
+        return [NSString stringWithFormat:@"%.1fK", count / 1000.0];
+    }
+    return [NSString stringWithFormat:@"%lld", count];
+}
+
+/**
+ * 与ViewController调用匹配的方法
+ */
+- (void)updateLikeCount:(NSInteger)likeCount isLiked:(BOOL)isLiked {
+    [self updateLikeUI:isLiked count:likeCount];
+}
+
+- (void)updateFavoriteCount:(NSInteger)favoriteCount isFavorited:(BOOL)isFavorited {
+    [self updateFavoriteUI:isFavorited count:favoriteCount];
+}
+
+#pragma mark - 按钮事件
+
+- (void)handleLikeTap {
+    if ([self.delegate respondsToSelector:@selector(shortDramaCellDidTapLike:)]) {
+        [self.delegate shortDramaCellDidTapLike:self];
+    } else {
+    }
+}
+
+- (void)handleFavoriteTap {
+    if ([self.delegate respondsToSelector:@selector(shortDramaCellDidTapFavorite:)]) {
+        [self.delegate shortDramaCellDidTapFavorite:self];
+    } else {
+    }
+}
+
+- (void)handleCommentTap {
+    
+    
+    if (self.delegate) {
+        SEL selector = @selector(shortDramaCellDidTapComment:);
+        BOOL responds = [self.delegate respondsToSelector:selector];
+       if (responds) {
+            [self.delegate shortDramaCellDidTapComment:self];
+        } else {
+        }
+    }
+}
+
+- (void)handleCollectionTap {
+    if ([self.delegate respondsToSelector:@selector(shortDramaCellDidTapCollection:)]) {
+        [self.delegate shortDramaCellDidTapCollection:self];
+    }
+}
+
+- (void)handleDetailTap {
+    if ([self.delegate respondsToSelector:@selector(shortDramaCellDidTapDetail:)]) {
+        [self.delegate shortDramaCellDidTapDetail:self];
+    }
+}
+
+#pragma mark - JXSuperPlayerDelegate
+
+- (void)superPlayerDidChangeState:(JXSuperPlayerState)state {
+    self.playerState = state;
+
+    switch (state) {
+        case JXSuperPlayerStatePreparing:
+            NSLog(@"[JXShortDramaCell] 播放器状态变更: 准备中");
+            // 开始播放时启动超时检测
+            [self startPlayTimeoutTimer];
+            break;
+
+        case JXSuperPlayerStatePlaying:
+            NSLog(@"[JXShortDramaCell] 播放器状态变更: 播放中");
+            // 成功开始播放,取消超时检测
+            [self stopPlayTimeoutTimer];
+            break;
+
+        case JXSuperPlayerStatePaused:
+            NSLog(@"[JXShortDramaCell] 播放器状态变更: 暂停");
+            break;
+
+        case JXSuperPlayerStateCompleted:
+            NSLog(@"[JXShortDramaCell] 播放器状态变更: 播放完成");
+            [self stopPlayTimeoutTimer];
+            break;
+
+        case JXSuperPlayerStateError:
+            NSLog(@"[JXShortDramaCell] 播放器状态变更: 错误");
+            [self stopPlayTimeoutTimer];
+            break;
+
+        default:
+            break;
+    }
+}
+
+// 播放超时检测
+- (void)startPlayTimeoutTimer {
+    [self stopPlayTimeoutTimer]; // 先停止之前的定时器
+
+    self.playStartTime = [NSDate date];
+
+    // 30秒超时检测
+    self.playTimeoutTimer = [NSTimer scheduledTimerWithTimeInterval:30.0
+                                                            target:self
+                                                          selector:@selector(onPlayTimeout)
+                                                          userInfo:nil
+                                                           repeats:NO];
+    NSLog(@"[JXShortDramaCell] 启动播放超时检测: 30秒");
+}
+
+- (void)stopPlayTimeoutTimer {
+    if (self.playTimeoutTimer) {
+        [self.playTimeoutTimer invalidate];
+        self.playTimeoutTimer = nil;
+        self.playStartTime = nil;
+        NSLog(@"[JXShortDramaCell] 停止播放超时检测");
+    }
+}
+
+- (void)onPlayTimeout {
+    NSLog(@"[JXShortDramaCell] 播放超时!30秒内未开始播放,触发恢复机制");
+
+    // 停止定时器
+    [self stopPlayTimeoutTimer];
+
+    // 触发播放失败处理
+    if ([self.delegate respondsToSelector:@selector(shortDramaCellDidFailToPlay:)]) {
+        [self.delegate shortDramaCellDidFailToPlay:self];
+    }
+}
+
+- (void)superPlayerDidUpdateProgress:(NSTimeInterval)currentTime duration:(NSTimeInterval)duration {
+    // 播放进度更新(可用于显示进度条)
+    // NSLog(@"[JXShortDramaCell] 播放进度: %.1f / %.1f", currentTime, duration);
+    float progress = currentTime/duration;
+    self.videoSlider.value = progress;
+}
+
+- (void)superPlayerDidFailWithError:(NSError *)error {
+    NSLog(@"[JXShortDramaCell] 播放失败: %@", error.localizedDescription);
+
+    // 检查是否是网络相关错误
+    BOOL isNetworkError = [error.domain isEqualToString:NSURLErrorDomain] &&
+                         (error.code == NSURLErrorTimedOut ||
+                          error.code == NSURLErrorCannotConnectToHost ||
+                          error.code == NSURLErrorNetworkConnectionLost ||
+                          error.code == NSURLErrorNotConnectedToInternet);
+
+    // 也检查播放器内部错误
+    BOOL isPlayerError = [error.domain isEqualToString:@"JXSuperPlayer"] ||
+                        [error.domain isEqualToString:@"TXVodPlayer"];
+
+    if (isNetworkError || isPlayerError) {
+        NSLog(@"[JXShortDramaCell] 检测到播放错误,尝试恢复: domain=%@, code=%ld",
+              error.domain, (long)error.code);
+
+        // 延迟3秒后通知控制器重新获取播放数据
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            if ([self.delegate respondsToSelector:@selector(shortDramaCellDidFailToPlay:)]) {
+                [self.delegate shortDramaCellDidFailToPlay:self];
+            }
+        });
+    } else {
+        // 其他类型的错误,直接显示
+        NSLog(@"[JXShortDramaCell] 非网络错误,不进行重试: %@", error);
+    }
+
+    // 显示错误提示(可以在这里添加UI反馈)
+    // TODO: 在UI上显示播放失败的提示,但不阻塞用户操作
+}
+
+#pragma mark - 生命周期
+
+- (void)dealloc {
+    // 清理定时器
+    [self stopPlayTimeoutTimer];
+
+    // 清理播放器
+    if (self.superPlayer) {
+        [self.superPlayer releasePlayer];
+    }
+}
+
+@end
+