Bladeren bron

1.添加一下视频播放的第三方 ,目前在线视频还播放不成功 报 Domain=AVFoundationErrorDomain Code=-11850 后端配置不适配iOS原因导致 待解决

huangxiaodong 1 jaar geleden
bovenliggende
commit
14b369b029
28 gewijzigde bestanden met toevoegingen van 4623 en 2 verwijderingen
  1. 120 2
      创维盒子/双子星云手机.xcodeproj/project.pbxproj
  2. 36 0
      创维盒子/双子星云手机/Class/Set/previewFile/previewImageOrVideoViewController.m
  3. 16 0
      创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.h
  4. 128 0
      创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.m
  5. 16 0
      创维盒子/双子星云手机/Class/Set/previewFile/videoPlayViewController.h
  6. 290 0
      创维盒子/双子星云手机/Class/Set/previewFile/videoPlayViewController.m
  7. 34 0
      创维盒子/双子星云手机/Class/Set/previewFile/view/ZFCustomControlView.h
  8. 606 0
      创维盒子/双子星云手机/Class/Set/previewFile/view/ZFCustomControlView.m
  9. 61 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/Root.plist
  10. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/en.lproj/Root.strings
  11. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_pause@2x.png
  12. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_pause@3x.png
  13. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play@2x.png
  14. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play@3x.png
  15. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play_hl@2x.png
  16. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play_hl@3x.png
  17. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/quanping@2x.png
  18. BIN
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/quanping@3x.png
  19. 45 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.h
  20. 648 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.m
  21. 46 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBVideoRequestTask.h
  22. 218 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBVideoRequestTask.m
  23. 30 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBloaderURLConnection.h
  24. 191 0
      创维盒子/双子星云手机/Vendor/TBPlayer/TBloaderURLConnection.m
  25. 435 0
      创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/MBProgressHUD.h
  26. 1484 0
      创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/MBProgressHUD.m
  27. 60 0
      创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/XCHudHelper.h
  28. 159 0
      创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/XCHudHelper.m

+ 120 - 2
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -287,6 +287,32 @@
 		6B5BE5872BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5842BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.h */; };
 		6B5BE5882BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5852BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m */; };
 		6B5BE5892BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5842BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.h */; };
+		6B5BE5922BFCA5FA00A1B9B3 /* videoPlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5912BFCA5FA00A1B9B3 /* videoPlayViewController.m */; };
+		6B5BE5932BFCA5FA00A1B9B3 /* videoPlayViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5902BFCA5FA00A1B9B3 /* videoPlayViewController.h */; };
+		6B5BE5942BFCA5FA00A1B9B3 /* videoPlayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5912BFCA5FA00A1B9B3 /* videoPlayViewController.m */; };
+		6B5BE5952BFCA5FA00A1B9B3 /* videoPlayViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5902BFCA5FA00A1B9B3 /* videoPlayViewController.h */; };
+		6B5BE5A62BFCCA1F00A1B9B3 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5992BFCCA1F00A1B9B3 /* MBProgressHUD.h */; };
+		6B5BE5A72BFCCA1F00A1B9B3 /* MBProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5992BFCCA1F00A1B9B3 /* MBProgressHUD.h */; };
+		6B5BE5A82BFCCA1F00A1B9B3 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE59A2BFCCA1F00A1B9B3 /* MBProgressHUD.m */; };
+		6B5BE5A92BFCCA1F00A1B9B3 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE59A2BFCCA1F00A1B9B3 /* MBProgressHUD.m */; };
+		6B5BE5AA2BFCCA1F00A1B9B3 /* XCHudHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE59B2BFCCA1F00A1B9B3 /* XCHudHelper.h */; };
+		6B5BE5AB2BFCCA1F00A1B9B3 /* XCHudHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE59B2BFCCA1F00A1B9B3 /* XCHudHelper.h */; };
+		6B5BE5AC2BFCCA2000A1B9B3 /* XCHudHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE59C2BFCCA1F00A1B9B3 /* XCHudHelper.m */; };
+		6B5BE5AD2BFCCA2000A1B9B3 /* XCHudHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE59C2BFCCA1F00A1B9B3 /* XCHudHelper.m */; };
+		6B5BE5AE2BFCCA2000A1B9B3 /* TBloaderURLConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE59E2BFCCA1F00A1B9B3 /* TBloaderURLConnection.h */; };
+		6B5BE5AF2BFCCA2000A1B9B3 /* TBloaderURLConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE59E2BFCCA1F00A1B9B3 /* TBloaderURLConnection.h */; };
+		6B5BE5B02BFCCA2000A1B9B3 /* TBloaderURLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE59F2BFCCA1F00A1B9B3 /* TBloaderURLConnection.m */; };
+		6B5BE5B12BFCCA2000A1B9B3 /* TBloaderURLConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE59F2BFCCA1F00A1B9B3 /* TBloaderURLConnection.m */; };
+		6B5BE5B22BFCCA2000A1B9B3 /* TBPlayer.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6B5BE5A02BFCCA1F00A1B9B3 /* TBPlayer.bundle */; };
+		6B5BE5B32BFCCA2000A1B9B3 /* TBPlayer.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6B5BE5A02BFCCA1F00A1B9B3 /* TBPlayer.bundle */; };
+		6B5BE5B42BFCCA2000A1B9B3 /* TBPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5A12BFCCA1F00A1B9B3 /* TBPlayer.h */; };
+		6B5BE5B52BFCCA2000A1B9B3 /* TBPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5A12BFCCA1F00A1B9B3 /* TBPlayer.h */; };
+		6B5BE5B62BFCCA2000A1B9B3 /* TBPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5A22BFCCA1F00A1B9B3 /* TBPlayer.m */; };
+		6B5BE5B72BFCCA2000A1B9B3 /* TBPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5A22BFCCA1F00A1B9B3 /* TBPlayer.m */; };
+		6B5BE5B82BFCCA2000A1B9B3 /* TBVideoRequestTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5A32BFCCA1F00A1B9B3 /* TBVideoRequestTask.h */; };
+		6B5BE5B92BFCCA2000A1B9B3 /* TBVideoRequestTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5A32BFCCA1F00A1B9B3 /* TBVideoRequestTask.h */; };
+		6B5BE5BA2BFCCA2000A1B9B3 /* TBVideoRequestTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5A42BFCCA1F00A1B9B3 /* TBVideoRequestTask.m */; };
+		6B5BE5BB2BFCCA2000A1B9B3 /* TBVideoRequestTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5A42BFCCA1F00A1B9B3 /* TBVideoRequestTask.m */; };
 		6B5D40152B47F27A000965CF /* couldPhoneCommonModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */; };
 		6B5D40162B47F27A000965CF /* couldPhoneCommonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */; };
 		6B5D401A2B4A9850000965CF /* couldPhoneFolderListModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D40182B4A9850000965CF /* couldPhoneFolderListModel.h */; };
@@ -307,6 +333,14 @@
 		6B5D40402B4CE40F000965CF /* downloadManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D403E2B4CE40F000965CF /* downloadManager.m */; };
 		6B5D40432B4CF04C000965CF /* PlayerViewController+downloadFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D40412B4CF04C000965CF /* PlayerViewController+downloadFile.h */; };
 		6B5D40442B4CF04C000965CF /* PlayerViewController+downloadFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D40422B4CF04C000965CF /* PlayerViewController+downloadFile.m */; };
+		6B63179C2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */; };
+		6B63179D2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */; };
+		6B63179E2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */; };
+		6B63179F2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */; };
+		6B6317A22BFD9DB500FF4FB4 /* ZFCustomControlView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B6317A02BFD9DB500FF4FB4 /* ZFCustomControlView.h */; };
+		6B6317A32BFD9DB500FF4FB4 /* ZFCustomControlView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B6317A02BFD9DB500FF4FB4 /* ZFCustomControlView.h */; };
+		6B6317A42BFD9DB500FF4FB4 /* ZFCustomControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B6317A12BFD9DB500FF4FB4 /* ZFCustomControlView.m */; };
+		6B6317A52BFD9DB500FF4FB4 /* ZFCustomControlView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B6317A12BFD9DB500FF4FB4 /* ZFCustomControlView.m */; };
 		6B72724B2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7272492B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h */; };
 		6B72724C2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */; };
 		6B72724F2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */; };
@@ -1199,6 +1233,19 @@
 		6B5BE57F2BFC81E300A1B9B3 /* NASFileAndFolderModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NASFileAndFolderModel.m; sourceTree = "<group>"; };
 		6B5BE5842BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = previewFileAndFolderSecondViewController.h; sourceTree = "<group>"; };
 		6B5BE5852BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = previewFileAndFolderSecondViewController.m; sourceTree = "<group>"; };
+		6B5BE5902BFCA5FA00A1B9B3 /* videoPlayViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = videoPlayViewController.h; sourceTree = "<group>"; };
+		6B5BE5912BFCA5FA00A1B9B3 /* videoPlayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = videoPlayViewController.m; sourceTree = "<group>"; };
+		6B5BE5992BFCCA1F00A1B9B3 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = "<group>"; };
+		6B5BE59A2BFCCA1F00A1B9B3 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; };
+		6B5BE59B2BFCCA1F00A1B9B3 /* XCHudHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCHudHelper.h; sourceTree = "<group>"; };
+		6B5BE59C2BFCCA1F00A1B9B3 /* XCHudHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCHudHelper.m; sourceTree = "<group>"; };
+		6B5BE59E2BFCCA1F00A1B9B3 /* TBloaderURLConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBloaderURLConnection.h; sourceTree = "<group>"; };
+		6B5BE59F2BFCCA1F00A1B9B3 /* TBloaderURLConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBloaderURLConnection.m; sourceTree = "<group>"; };
+		6B5BE5A02BFCCA1F00A1B9B3 /* TBPlayer.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TBPlayer.bundle; sourceTree = "<group>"; };
+		6B5BE5A12BFCCA1F00A1B9B3 /* TBPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBPlayer.h; sourceTree = "<group>"; };
+		6B5BE5A22BFCCA1F00A1B9B3 /* TBPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBPlayer.m; sourceTree = "<group>"; };
+		6B5BE5A32BFCCA1F00A1B9B3 /* TBVideoRequestTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBVideoRequestTask.h; sourceTree = "<group>"; };
+		6B5BE5A42BFCCA1F00A1B9B3 /* TBVideoRequestTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBVideoRequestTask.m; sourceTree = "<group>"; };
 		6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = couldPhoneCommonModel.h; sourceTree = "<group>"; };
 		6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = couldPhoneCommonModel.m; sourceTree = "<group>"; };
 		6B5D40182B4A9850000965CF /* couldPhoneFolderListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = couldPhoneFolderListModel.h; sourceTree = "<group>"; };
@@ -1219,6 +1266,10 @@
 		6B5D403E2B4CE40F000965CF /* downloadManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = downloadManager.m; sourceTree = "<group>"; };
 		6B5D40412B4CF04C000965CF /* PlayerViewController+downloadFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PlayerViewController+downloadFile.h"; sourceTree = "<group>"; };
 		6B5D40422B4CF04C000965CF /* PlayerViewController+downloadFile.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "PlayerViewController+downloadFile.m"; sourceTree = "<group>"; };
+		6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = videoPlayByAVPlayerViewController.h; sourceTree = "<group>"; };
+		6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = videoPlayByAVPlayerViewController.m; sourceTree = "<group>"; };
+		6B6317A02BFD9DB500FF4FB4 /* ZFCustomControlView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZFCustomControlView.h; sourceTree = "<group>"; };
+		6B6317A12BFD9DB500FF4FB4 /* ZFCustomControlView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZFCustomControlView.m; sourceTree = "<group>"; };
 		6B7272492B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordTableViewHeadView.h; sourceTree = "<group>"; };
 		6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordTableViewHeadView.m; sourceTree = "<group>"; };
 		6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordEditBottomView.h; sourceTree = "<group>"; };
@@ -2066,6 +2117,10 @@
 				6B3AD6892BF4AE630096D6B7 /* backupsOptionViewController.m */,
 				6B7EA7A22BF607FB002D5CC2 /* imageDetailsScrollViewController.h */,
 				6B7EA7A32BF607FB002D5CC2 /* imageDetailsScrollViewController.m */,
+				6B5BE5902BFCA5FA00A1B9B3 /* videoPlayViewController.h */,
+				6B5BE5912BFCA5FA00A1B9B3 /* videoPlayViewController.m */,
+				6B63179A2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h */,
+				6B63179B2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m */,
 			);
 			path = previewFile;
 			sourceTree = "<group>";
@@ -2073,6 +2128,8 @@
 		6B34DC512BF1C1A3002DD1EF /* view */ = {
 			isa = PBXGroup;
 			children = (
+				6B6317A02BFD9DB500FF4FB4 /* ZFCustomControlView.h */,
+				6B6317A12BFD9DB500FF4FB4 /* ZFCustomControlView.m */,
 				6B34DC642BF1FFB1002DD1EF /* imageCollectionViewCell.h */,
 				6B34DC652BF1FFB1002DD1EF /* imageCollectionViewCell.m */,
 				6B34DC6A2BF2070D002DD1EF /* titleLabelReusableView.h */,
@@ -2154,6 +2211,32 @@
 			path = view;
 			sourceTree = "<group>";
 		};
+		6B5BE59D2BFCCA1F00A1B9B3 /* XCToast */ = {
+			isa = PBXGroup;
+			children = (
+				6B5BE5992BFCCA1F00A1B9B3 /* MBProgressHUD.h */,
+				6B5BE59A2BFCCA1F00A1B9B3 /* MBProgressHUD.m */,
+				6B5BE59B2BFCCA1F00A1B9B3 /* XCHudHelper.h */,
+				6B5BE59C2BFCCA1F00A1B9B3 /* XCHudHelper.m */,
+			);
+			path = XCToast;
+			sourceTree = "<group>";
+		};
+		6B5BE5A52BFCCA1F00A1B9B3 /* TBPlayer */ = {
+			isa = PBXGroup;
+			children = (
+				6B5BE59D2BFCCA1F00A1B9B3 /* XCToast */,
+				6B5BE59E2BFCCA1F00A1B9B3 /* TBloaderURLConnection.h */,
+				6B5BE59F2BFCCA1F00A1B9B3 /* TBloaderURLConnection.m */,
+				6B5BE5A02BFCCA1F00A1B9B3 /* TBPlayer.bundle */,
+				6B5BE5A12BFCCA1F00A1B9B3 /* TBPlayer.h */,
+				6B5BE5A22BFCCA1F00A1B9B3 /* TBPlayer.m */,
+				6B5BE5A32BFCCA1F00A1B9B3 /* TBVideoRequestTask.h */,
+				6B5BE5A42BFCCA1F00A1B9B3 /* TBVideoRequestTask.m */,
+			);
+			path = TBPlayer;
+			sourceTree = "<group>";
+		};
 		6B5D40172B4A70AB000965CF /* uploadFileView */ = {
 			isa = PBXGroup;
 			children = (
@@ -2338,6 +2421,7 @@
 		A003F6B727D841FF00715CBF /* Vendor */ = {
 			isa = PBXGroup;
 			children = (
+				6B5BE5A52BFCCA1F00A1B9B3 /* TBPlayer */,
 				6B304E9C2BEF6879004F5580 /* TencentOpenAPI.framework */,
 				6BBB35DF2AE935C000E4A59B /* DDYLanguageTool */,
 				6BBB35D42AE7645200E4A59B /* BackgroundKeepAlive */,
@@ -2688,6 +2772,7 @@
 				6B467BB32BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				183AE6D12A8CA98C00B11CB0 /* CloudPhoneAPI.h in Headers */,
 				6B07AC252BF85859005C2B0E /* ShareRecordModel.h in Headers */,
+				6B5BE5932BFCA5FA00A1B9B3 /* videoPlayViewController.h in Headers */,
 				1868201D2AB97BE1005702A6 /* TipsQRCodeViewController.h in Headers */,
 				6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */,
 				181E85002A8F6B1800292B96 /* LogoSelectView.h in Headers */,
@@ -2703,6 +2788,7 @@
 				6B1FBD262B4503E700926382 /* photosBackupsTaskModel.h in Headers */,
 				6B34DC4E2BF1BA11002DD1EF /* previewImageOrVideoViewController.h in Headers */,
 				6BFF26882AF8949F00FCB4F7 /* playerShowSecretkeyView.h in Headers */,
+				6B5BE5B42BFCCA2000A1B9B3 /* TBPlayer.h in Headers */,
 				6BF0F3D52AD3937B000AA133 /* DeviceThirdIdModel.h in Headers */,
 				6B2170982B15CD9200656670 /* NSDictionary+Log.h in Headers */,
 				6B1FBD362B455DD600926382 /* PlayerViewController+backupsFile.h in Headers */,
@@ -2719,8 +2805,10 @@
 				6B5B607A2B3E71B6009A2AE2 /* filePathCreatTableViewCell.h in Headers */,
 				18FCE5442AD136FF0020F623 /* ShortcutManager.h in Headers */,
 				6B2170A02B15D39900656670 /* privacyModeTipViewController.h in Headers */,
+				6B63179D2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h in Headers */,
 				181E84FB2A8F57A500292B96 /* ChangeLogoViewController.h in Headers */,
 				6B5B606A2B3D67B2009A2AE2 /* fileSetTableViewCell.h in Headers */,
+				6B5BE5AA2BFCCA1F00A1B9B3 /* XCHudHelper.h in Headers */,
 				18C4754F2A8E0DB5006129C0 /* MySetViewController.h in Headers */,
 				18FCE53F2AD136670020F623 /* PlayerViewController+TouchPointXD.h in Headers */,
 				18FCE53E2AD136670020F623 /* PlayerViewController+AdjustBtnFrame.h in Headers */,
@@ -2773,9 +2861,11 @@
 				6B9354952BF33F2700AA8D31 /* editShareView.h in Headers */,
 				184C8AD52A949D5900F26650 /* AboutViewController.h in Headers */,
 				6B34DC672BF1FFB1002DD1EF /* imageCollectionViewCell.h in Headers */,
+				6B5BE5B82BFCCA2000A1B9B3 /* TBVideoRequestTask.h in Headers */,
 				6B0581A22AFCF50300D37290 /* AJPhotoListCell.h in Headers */,
 				6B3AD68A2BF4AE630096D6B7 /* backupsOptionViewController.h in Headers */,
 				187076772A9F400300F15F7F /* PlayerLoadingView.h in Headers */,
+				6B5BE5AE2BFCCA2000A1B9B3 /* TBloaderURLConnection.h in Headers */,
 				6B7EA7982BF5B4A6002D5CC2 /* NASFilePicModel.h in Headers */,
 				6B1CC2CE2B6B6D6B00AD4217 /* commandSendCheckModel.h in Headers */,
 				6B0581602AFCD0DF00D37290 /* uploadImageOrVideoViewController.h in Headers */,
@@ -2783,6 +2873,7 @@
 				6B07AC2B2BF8D38F005C2B0E /* NASFileAudioModel.h in Headers */,
 				6B5B60722B3D8098009A2AE2 /* fileTransferPathCheckTableViewCell.h in Headers */,
 				6B3A4B152B6F69A500F74679 /* cloudPhoneCommonModel.h in Headers */,
+				6B5BE5A62BFCCA1F00A1B9B3 /* MBProgressHUD.h in Headers */,
 				6B05819F2AFCF4E800D37290 /* AJPhotoListView.h in Headers */,
 				6B9354A72BF3848D00AA8D31 /* shareRecordViewController.h in Headers */,
 				18963B462AB84398006E7C50 /* GuideView.h in Headers */,
@@ -2798,6 +2889,7 @@
 				6B5D402F2B4BCBC1000965CF /* downLoadPreViewCell.h in Headers */,
 				6B0581AD2AFCF57300D37290 /* AJPhotoGroupView.h in Headers */,
 				6B3AD6842BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h in Headers */,
+				6B6317A22BFD9DB500FF4FB4 /* ZFCustomControlView.h in Headers */,
 				18F9CB072ABD7835003FF71A /* QRCodeScanForChangeDeviceViewController.h in Headers */,
 				6B45C5042B5F9CEC007E6911 /* diskListTableView.h in Headers */,
 				6B5BE57B2BFC767100A1B9B3 /* previewFileAndFolderViewController.h in Headers */,
@@ -2842,6 +2934,7 @@
 				6B467BB52BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				6BD506A92B9576A4006E7CB0 /* CloudPhoneAPI.h in Headers */,
 				6B07AC282BF85859005C2B0E /* ShareRecordModel.h in Headers */,
+				6B5BE5952BFCA5FA00A1B9B3 /* videoPlayViewController.h in Headers */,
 				6BD506AA2B9576A4006E7CB0 /* TipsQRCodeViewController.h in Headers */,
 				6BD506AB2B9576A4006E7CB0 /* fileTransferPopView.h in Headers */,
 				6BD506AC2B9576A4006E7CB0 /* LogoSelectView.h in Headers */,
@@ -2857,6 +2950,7 @@
 				6BD506B62B9576A4006E7CB0 /* photosBackupsTaskModel.h in Headers */,
 				6B34DC502BF1BA11002DD1EF /* previewImageOrVideoViewController.h in Headers */,
 				6BD506B72B9576A4006E7CB0 /* playerShowSecretkeyView.h in Headers */,
+				6B5BE5B52BFCCA2000A1B9B3 /* TBPlayer.h in Headers */,
 				6BD506B82B9576A4006E7CB0 /* DeviceThirdIdModel.h in Headers */,
 				6BD506B92B9576A4006E7CB0 /* NSDictionary+Log.h in Headers */,
 				6BD506BA2B9576A4006E7CB0 /* PlayerViewController+backupsFile.h in Headers */,
@@ -2873,8 +2967,10 @@
 				6BD506C42B9576A4006E7CB0 /* filePathCreatTableViewCell.h in Headers */,
 				6BD506C52B9576A4006E7CB0 /* ShortcutManager.h in Headers */,
 				6BD506C62B9576A4006E7CB0 /* privacyModeTipViewController.h in Headers */,
+				6B63179E2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.h in Headers */,
 				6BD506C72B9576A4006E7CB0 /* ChangeLogoViewController.h in Headers */,
 				6BD506C82B9576A4006E7CB0 /* fileSetTableViewCell.h in Headers */,
+				6B5BE5AB2BFCCA1F00A1B9B3 /* XCHudHelper.h in Headers */,
 				6BD506C92B9576A4006E7CB0 /* MySetViewController.h in Headers */,
 				6BD506CA2B9576A4006E7CB0 /* PlayerViewController+TouchPointXD.h in Headers */,
 				6BD506CB2B9576A4006E7CB0 /* PlayerViewController+AdjustBtnFrame.h in Headers */,
@@ -2927,9 +3023,11 @@
 				6B9354962BF33F2700AA8D31 /* editShareView.h in Headers */,
 				6BD506F22B9576A4006E7CB0 /* AboutViewController.h in Headers */,
 				6B34DC692BF1FFB1002DD1EF /* imageCollectionViewCell.h in Headers */,
+				6B5BE5B92BFCCA2000A1B9B3 /* TBVideoRequestTask.h in Headers */,
 				6BD506F32B9576A4006E7CB0 /* AJPhotoListCell.h in Headers */,
 				6B3AD68D2BF4AE630096D6B7 /* backupsOptionViewController.h in Headers */,
 				6BD506F42B9576A4006E7CB0 /* PlayerLoadingView.h in Headers */,
+				6B5BE5AF2BFCCA2000A1B9B3 /* TBloaderURLConnection.h in Headers */,
 				6B7EA79A2BF5B4A6002D5CC2 /* NASFilePicModel.h in Headers */,
 				6BD506F52B9576A4006E7CB0 /* commandSendCheckModel.h in Headers */,
 				6BD506F62B9576A4006E7CB0 /* uploadImageOrVideoViewController.h in Headers */,
@@ -2937,6 +3035,7 @@
 				6B07AC2E2BF8D38F005C2B0E /* NASFileAudioModel.h in Headers */,
 				6BD506F82B9576A4006E7CB0 /* fileTransferPathCheckTableViewCell.h in Headers */,
 				6BD506F92B9576A4006E7CB0 /* cloudPhoneCommonModel.h in Headers */,
+				6B5BE5A72BFCCA1F00A1B9B3 /* MBProgressHUD.h in Headers */,
 				6BD506FA2B9576A4006E7CB0 /* AJPhotoListView.h in Headers */,
 				6B9354A82BF3848D00AA8D31 /* shareRecordViewController.h in Headers */,
 				6BD506FB2B9576A4006E7CB0 /* GuideView.h in Headers */,
@@ -2952,6 +3051,7 @@
 				6BD507032B9576A4006E7CB0 /* downLoadPreViewCell.h in Headers */,
 				6BD507042B9576A4006E7CB0 /* AJPhotoGroupView.h in Headers */,
 				6B3AD6872BF48DBA0096D6B7 /* shareRecordDetailsHWViewController.h in Headers */,
+				6B6317A32BFD9DB500FF4FB4 /* ZFCustomControlView.h in Headers */,
 				6BD507052B9576A4006E7CB0 /* QRCodeScanForChangeDeviceViewController.h in Headers */,
 				6BD507062B9576A4006E7CB0 /* diskListTableView.h in Headers */,
 				6B5BE57D2BFC767100A1B9B3 /* previewFileAndFolderViewController.h in Headers */,
@@ -3132,6 +3232,7 @@
 				6BD507FC2B9576A4006E7CB0 /* HWPageViewController.xib in Resources */,
 				6BD507FD2B9576A4006E7CB0 /* HWPageListCell.xib in Resources */,
 				6BD507FE2B9576A4006E7CB0 /* ConnectTestViewController.xib in Resources */,
+				6B5BE5B32BFCCA2000A1B9B3 /* TBPlayer.bundle in Resources */,
 				6BD507FF2B9576A4006E7CB0 /* HWHomeListCell.xib in Resources */,
 				6BD508002B9576A4006E7CB0 /* HWToolListCell.xib in Resources */,
 				6BD508012B9576A4006E7CB0 /* LaunchScreen.storyboard in Resources */,
@@ -3168,6 +3269,7 @@
 				A08A94DC27E97DB800C544BB /* HWPageViewController.xib in Resources */,
 				A08A94E127E9837600C544BB /* HWPageListCell.xib in Resources */,
 				18FCE5342AD12FE00020F623 /* ConnectTestViewController.xib in Resources */,
+				6B5BE5B22BFCCA2000A1B9B3 /* TBPlayer.bundle in Resources */,
 				A084D69927E8657800054880 /* HWHomeListCell.xib in Resources */,
 				A084D68F27E859D300054880 /* HWToolListCell.xib in Resources */,
 				A003F6E427D8428200715CBF /* LaunchScreen.storyboard in Resources */,
@@ -3382,6 +3484,7 @@
 				6BD5072F2B9576A4006E7CB0 /* cloudPhoneExtraFileListModel.m in Sources */,
 				6BD507302B9576A4006E7CB0 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
 				6BD507312B9576A4006E7CB0 /* BaseViewController.m in Sources */,
+				6B63179F2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */,
 				6BD507322B9576A4006E7CB0 /* PlayerViewController+upLoadFile.m in Sources */,
 				6BD507332B9576A4006E7CB0 /* Calculator.m in Sources */,
 				6B93549D2BF369D000AA8D31 /* previewToUploadFileView.m in Sources */,
@@ -3399,8 +3502,10 @@
 				6BD5073E2B9576A4006E7CB0 /* AFAutoPurgingImageCache.m in Sources */,
 				6BD5073F2B9576A4006E7CB0 /* AuthCodeInputView.m in Sources */,
 				6BD507402B9576A4006E7CB0 /* DDYLanguageTool.m in Sources */,
+				6B5BE5BB2BFCCA2000A1B9B3 /* TBVideoRequestTask.m in Sources */,
 				6B7EA7A12BF5E0ED002D5CC2 /* NASMsgModel.m in Sources */,
 				6BD507412B9576A4006E7CB0 /* AudioSessionObject.m in Sources */,
+				6B5BE5B12BFCCA2000A1B9B3 /* TBloaderURLConnection.m in Sources */,
 				6BD507422B9576A4006E7CB0 /* ChangeLogoViewController.m in Sources */,
 				6BD507432B9576A4006E7CB0 /* uploadFileRecordheadView.m in Sources */,
 				6BD507442B9576A4006E7CB0 /* HWAgreementViewController.m in Sources */,
@@ -3411,6 +3516,7 @@
 				6BD507472B9576A4006E7CB0 /* USBInsertPopView.m in Sources */,
 				6BD507482B9576A4006E7CB0 /* SetUsePWDViewController.m in Sources */,
 				6BD507492B9576A4006E7CB0 /* cloudPhoneCommonModel.m in Sources */,
+				6B6317A52BFD9DB500FF4FB4 /* ZFCustomControlView.m in Sources */,
 				6BD5074A2B9576A4006E7CB0 /* UIView+View.m in Sources */,
 				6B9354912BF30A8C00AA8D31 /* editTypeBottomView.m in Sources */,
 				6BD5074B2B9576A4006E7CB0 /* couldPhoneFileListModel.m in Sources */,
@@ -3456,7 +3562,9 @@
 				6BD507702B9576A4006E7CB0 /* JSONHTTPClient.m in Sources */,
 				6BD507712B9576A4006E7CB0 /* AFImageDownloader.m in Sources */,
 				6BD507722B9576A4006E7CB0 /* UIColor+HZXColor.m in Sources */,
+				6B5BE5AD2BFCCA2000A1B9B3 /* XCHudHelper.m in Sources */,
 				6BD507732B9576A4006E7CB0 /* CalculatorViewController.m in Sources */,
+				6B5BE5942BFCA5FA00A1B9B3 /* videoPlayViewController.m in Sources */,
 				6BD507742B9576A4006E7CB0 /* extraMediaEventModel.m in Sources */,
 				6BD507752B9576A4006E7CB0 /* couldPhoneFolderListModel.m in Sources */,
 				6BD507762B9576A4006E7CB0 /* backupsFileManager.m in Sources */,
@@ -3481,6 +3589,7 @@
 				6BD507872B9576A4006E7CB0 /* uploadFileDataModel.m in Sources */,
 				6BD507882B9576A4006E7CB0 /* UITextField+SPExtension.m in Sources */,
 				6BD507892B9576A4006E7CB0 /* CustomerWebViewController.m in Sources */,
+				6B5BE5A92BFCCA1F00A1B9B3 /* MBProgressHUD.m in Sources */,
 				6BD5078A2B9576A4006E7CB0 /* NSObject+BGModel.m in Sources */,
 				6BD5078B2B9576A4006E7CB0 /* HelpDownScrollView.m in Sources */,
 				6BD5078C2B9576A4006E7CB0 /* fileSetTableViewCell.m in Sources */,
@@ -3489,6 +3598,7 @@
 				6BD5078F2B9576A4006E7CB0 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
 				6BD507902B9576A4006E7CB0 /* cachesFileManager.m in Sources */,
 				6B5BE5882BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m in Sources */,
+				6B5BE5B72BFCCA2000A1B9B3 /* TBPlayer.m in Sources */,
 				6BD507912B9576A4006E7CB0 /* HWVersionModel.m in Sources */,
 				6B5BE57C2BFC767100A1B9B3 /* previewFileAndFolderViewController.m in Sources */,
 				6BD507922B9576A4006E7CB0 /* NSArray+Log.m in Sources */,
@@ -3621,6 +3731,7 @@
 				6B45C4FE2B57BC87007E6911 /* cloudPhoneExtraFileListModel.m in Sources */,
 				183AE6512A8A2CF000B11CB0 /* UIActivityIndicatorView+AFNetworking.m in Sources */,
 				A003F6A627D841C800715CBF /* BaseViewController.m in Sources */,
+				6B63179C2BFD8CA000FF4FB4 /* videoPlayByAVPlayerViewController.m in Sources */,
 				6B1FBD332B455DBD00926382 /* PlayerViewController+upLoadFile.m in Sources */,
 				18E557212A3C5D75005CC84B /* Calculator.m in Sources */,
 				6B93549A2BF369D000AA8D31 /* previewToUploadFileView.m in Sources */,
@@ -3638,8 +3749,10 @@
 				183AE6522A8A2CF000B11CB0 /* AFAutoPurgingImageCache.m in Sources */,
 				6BFF26962AF9D8CC00FCB4F7 /* AuthCodeInputView.m in Sources */,
 				6BBB35E32AE935C000E4A59B /* DDYLanguageTool.m in Sources */,
+				6B5BE5BA2BFCCA2000A1B9B3 /* TBVideoRequestTask.m in Sources */,
 				6B7EA79F2BF5E0ED002D5CC2 /* NASMsgModel.m in Sources */,
 				6BBB35DE2AE76AD800E4A59B /* AudioSessionObject.m in Sources */,
+				6B5BE5B02BFCCA2000A1B9B3 /* TBloaderURLConnection.m in Sources */,
 				181E84FC2A8F57A500292B96 /* ChangeLogoViewController.m in Sources */,
 				6B8FF6BA2B04E19600800981 /* uploadFileRecordheadView.m in Sources */,
 				A031DD7F27EC78C800909527 /* HWAgreementViewController.m in Sources */,
@@ -3650,6 +3763,7 @@
 				6B1CC2CB2B67A5FC00AD4217 /* USBInsertPopView.m in Sources */,
 				18E557262A3C6088005CC84B /* SetUsePWDViewController.m in Sources */,
 				6B3A4B162B6F69A500F74679 /* cloudPhoneCommonModel.m in Sources */,
+				6B6317A42BFD9DB500FF4FB4 /* ZFCustomControlView.m in Sources */,
 				183AE6D52A8CAFAE00B11CB0 /* UIView+View.m in Sources */,
 				6B93548E2BF30A8C00AA8D31 /* editTypeBottomView.m in Sources */,
 				6B5D40282B4BC402000965CF /* couldPhoneFileListModel.m in Sources */,
@@ -3695,7 +3809,9 @@
 				183AE6082A89CE3C00B11CB0 /* JSONHTTPClient.m in Sources */,
 				183AE6532A8A2CF000B11CB0 /* AFImageDownloader.m in Sources */,
 				A003F6B327D841EE00715CBF /* UIColor+HZXColor.m in Sources */,
+				6B5BE5AC2BFCCA2000A1B9B3 /* XCHudHelper.m in Sources */,
 				18E557222A3C5D75005CC84B /* CalculatorViewController.m in Sources */,
+				6B5BE5922BFCA5FA00A1B9B3 /* videoPlayViewController.m in Sources */,
 				6B1CC2C72B677F3E00AD4217 /* extraMediaEventModel.m in Sources */,
 				6B5D401B2B4A9850000965CF /* couldPhoneFolderListModel.m in Sources */,
 				6B1FBD2B2B452B3800926382 /* backupsFileManager.m in Sources */,
@@ -3720,6 +3836,7 @@
 				6B05828A2B045E0B00D37290 /* uploadFileDataModel.m in Sources */,
 				18E557322A3C6151005CC84B /* UITextField+SPExtension.m in Sources */,
 				184C8AD12A94980D00F26650 /* CustomerWebViewController.m in Sources */,
+				6B5BE5A82BFCCA1F00A1B9B3 /* MBProgressHUD.m in Sources */,
 				A08A94FD27E9A4E400C544BB /* NSObject+BGModel.m in Sources */,
 				181E84F32A8F0A9B00292B96 /* HelpDownScrollView.m in Sources */,
 				6B5B606B2B3D67B2009A2AE2 /* fileSetTableViewCell.m in Sources */,
@@ -3728,6 +3845,7 @@
 				18FCE5412AD136670020F623 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
 				6B7272542B0CABC600C03F87 /* cachesFileManager.m in Sources */,
 				6B5BE5862BFC8B0B00A1B9B3 /* previewFileAndFolderSecondViewController.m in Sources */,
+				6B5BE5B62BFCCA2000A1B9B3 /* TBPlayer.m in Sources */,
 				184C8ADE2A949DBD00F26650 /* HWVersionModel.m in Sources */,
 				6B5BE57A2BFC767100A1B9B3 /* previewFileAndFolderViewController.m in Sources */,
 				6B21709D2B15CDB600656670 /* NSArray+Log.m in Sources */,
@@ -4238,7 +4356,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (
@@ -4319,7 +4437,7 @@
 				CODE_SIGN_IDENTITY = "Apple Development";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CODE_SIGN_STYLE = Manual;
-				CURRENT_PROJECT_VERSION = 3;
+				CURRENT_PROJECT_VERSION = 4;
 				DEVELOPMENT_TEAM = "";
 				"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 6SV76WTUUR;
 				FRAMEWORK_SEARCH_PATHS = (

+ 36 - 0
创维盒子/双子星云手机/Class/Set/previewFile/previewImageOrVideoViewController.m

@@ -23,6 +23,8 @@
 #import "NASFilePicModel.h"
 #import "imageDetailsScrollViewController.h"
 #import "queryShareModel.h"
+#import "videoPlayViewController.h"
+#import "videoPlayByAVPlayerViewController.h"
 
 @interface previewImageOrVideoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -421,6 +423,9 @@
             if(_isPhotoType){
                 [self didClickPicDetailsWithSection:section withRow:row];
             }
+            else{
+                [self didClickVideoWithSection:section withRow:row];
+            }
         }
     }
 }
@@ -925,6 +930,37 @@
     }
 }
 
+#pragma mark 点击视频详情
+- (void)didClickVideoWithSection:(NSInteger)section withRow:(NSInteger)row{
+    
+    if(_curNASFilePicModel){
+        if(section < _curNASFilePicModel.data.fileList.count){
+            NASFilePicTimeArrModel *timeModel = _curNASFilePicModel.data.fileList[section];
+            
+            if(row < timeModel.list.count){
+                NASFilePicDataArrModel *dataModel = timeModel.list[row];
+                videoPlayViewController *vc = [videoPlayViewController new];
+                //videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
+                vc.VideoDataMode = dataModel;
+                [self.navigationController pushViewController:vc animated:YES];
+            }
+        }
+        
+        
+//        imageDetailsScrollViewController *vc = [imageDetailsScrollViewController new];
+//        vc.index = index;
+//        vc.totalDataArr = totalArr;
+//        [self.navigationController pushViewController:vc animated:YES];
+//        vc.canShareType = canShareType;
+//        
+//        KWeakSelf
+//        vc.didNeedToRegetDataFun = ^{
+//            [weakSelf getFileListFun];
+//        };
+    }
+}
+
+
 - (void)gotoDownLoadFileFun
 {
     if(_didSelectListArr.count == 0){

+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.h

@@ -0,0 +1,16 @@
+//
+//  videoPlayByAVPlayerViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/22.
+//
+
+#import "BaseViewController.h"
+#import "NASFilePicModel.h"
+NS_ASSUME_NONNULL_BEGIN
+
+@interface videoPlayByAVPlayerViewController : BaseViewController
+@property(nonatomic,strong) NASFilePicDataArrModel *VideoDataMode;
+@end
+
+NS_ASSUME_NONNULL_END

+ 128 - 0
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayByAVPlayerViewController.m

@@ -0,0 +1,128 @@
+//
+//  videoPlayByAVPlayerViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/22.
+//
+
+#import "videoPlayByAVPlayerViewController.h"
+
+#import "ZFCustomControlView.h"
+#import <ZFPlayer/ZFAVPlayerManager.h>
+#import <ZFPlayer/ZFIJKPlayerManager.h>
+#import <ZFPlayer/ZFPlayerControlView.h>
+#import <ZFPlayer/UIView+ZFFrame.h>
+#import <ZFPlayer/ZFPlayerConst.h>
+#import "UIImageView+ZFCache.h"
+#import "ZFUtilities.h"
+
+@interface videoPlayByAVPlayerViewController ()
+@property (nonatomic, strong) ZFPlayerController *player;
+@property (nonatomic, strong) ZFAVPlayerManager *playerManager;
+@property (nonatomic, strong) UIImageView *containerView;
+@property (nonatomic, strong) ZFCustomControlView *controlView;
+
+@end
+
+@implementation videoPlayByAVPlayerViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    //self.navBarBGView.backgroundColor = [UIColor whiteColor];
+    [self.view setBackgroundColor:[UIColor whiteColor]];
+    
+    [self.view addSubview:self.containerView];
+    self.playerManager = [[ZFAVPlayerManager alloc] init];
+    /// 播放器相关
+    self.player = [ZFPlayerController playerWithPlayerManager:self.playerManager containerView:self.containerView];
+    self.player.controlView = self.controlView;
+    /// 设置退到后台继续播放
+    self.player.pauseWhenAppResignActive = NO;
+    
+    @zf_weakify(self)
+    /// 播放完成
+    self.player.playerDidToEnd = ^(id  _Nonnull asset) {
+        @zf_strongify(self)
+        [self.player.currentPlayerManager replay];
+        [self.player playTheNext];
+        if (!self.player.isLastAssetURL) {
+            NSString *title = [NSString stringWithFormat:@"视频标题%zd",self.player.currentPlayIndex];
+            [self.controlView showTitle:title coverURLString:nil fullScreenMode:ZFFullScreenModeLandscape];
+        } else {
+            [self.player stop];
+        }
+    };
+    
+    
+    [self.controlView showTitle:@"自定义控制层" coverURLString:nil fullScreenMode:ZFFullScreenModeAutomatic];
+
+}
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    self.player.viewControllerDisappear = NO;
+    
+    NSString *filePath = _VideoDataMode.path;
+    NSString *urlStr = ksharedAppDelegate.NASFileService;
+    NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
+    fileUrl = [fileUrl  stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    
+    NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];
+    
+    self.playerManager.assetURL = sourceMovieURL;
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    self.player.viewControllerDisappear = YES;
+}
+
+- (void)viewWillLayoutSubviews {
+    [super viewWillLayoutSubviews];
+    CGFloat x = 0;
+    CGFloat y = CGRectGetMaxY(self.navigationController.navigationBar.frame);
+    CGFloat w = CGRectGetWidth(self.view.frame);
+    CGFloat h = w*9/16;
+    self.containerView.frame = CGRectMake(x, y, w, h);
+}
+
+- (UIStatusBarStyle)preferredStatusBarStyle {
+    return UIStatusBarStyleDefault;
+}
+
+- (BOOL)prefersStatusBarHidden {
+    return NO;
+}
+
+- (BOOL)shouldAutorotate {
+    return NO;
+}
+
+- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
+    if (self.player.isFullScreen) {
+        return UIInterfaceOrientationMaskLandscape;
+    }
+    return UIInterfaceOrientationMaskPortrait;
+}
+
+- (ZFCustomControlView *)controlView {
+    if (!_controlView) {
+        _controlView = [ZFCustomControlView new];
+    }
+    return _controlView;
+}
+
+- (UIImageView *)containerView {
+    if (!_containerView) {
+        _containerView = [UIImageView new];
+        [_containerView setImageWithURLString:nil placeholder:[ZFUtilities imageWithColor:[UIColor colorWithRed:220/255.0 green:220/255.0 blue:220/255.0 alpha:1] size:CGSizeMake(1, 1)]];
+    }
+    return _containerView;
+}
+
+@end

+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayViewController.h

@@ -0,0 +1,16 @@
+//
+//  videoPlayViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/21.
+//
+
+#import "BaseViewController.h"
+#import "NASFilePicModel.h"
+NS_ASSUME_NONNULL_BEGIN
+
+@interface videoPlayViewController : BaseViewController
+@property(nonatomic,strong) NASFilePicDataArrModel *VideoDataMode;
+@end
+
+NS_ASSUME_NONNULL_END

+ 290 - 0
创维盒子/双子星云手机/Class/Set/previewFile/videoPlayViewController.m

@@ -0,0 +1,290 @@
+//
+//  videoPlayViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/21.
+//
+
+#import "videoPlayViewController.h"
+#import <WebKit/WebKit.h>
+
+#import  <AVFoundation/AVFoundation.h>
+
+#import "TBPlayer.h"
+
+@interface videoPlayViewController ()<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler>
+
+@property (nonatomic, strong) WKWebView *curWKWebView;
+@property (nonatomic, strong)AVPlayer*player;
+@end
+
+@implementation videoPlayViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    //self.navBarBGView.backgroundColor = [UIColor whiteColor];
+    [self.view setBackgroundColor:[UIColor whiteColor]];
+    
+    //[self setUpVideoPlayer];
+    
+    
+}
+
+#pragma mark ---播放器
+- (void)setUpVideoPlayer {
+    //创建网页配置对象
+     WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
+     
+     // 是使用h5的视频播放器在线播放, 还是使用原生播放器全屏播放
+     //config.allowsInlineMediaPlayback = YES;
+     //设置视频是否需要用户手动播放  设置为NO则会允许自动播放
+     config.mediaTypesRequiringUserActionForPlayback = NO;
+     //设置是否允许画中画技术 在特定设备上有效
+     config.allowsPictureInPictureMediaPlayback = NO;
+    
+     //设置请求的User-Agent信息中应用程序名称 iOS9后可用
+     //config.applicationNameForUserAgent = @"ChinaDailyForiPad";
+      //自定义的WKScriptMessageHandler 是为了解决内存不释放的问题
+//      WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
+     
+    
+    //这个类主要用来做native与JavaScript的交互管理
+    // 注入js 解决进入播放就横屏问题
+    WKUserContentController *content = [[WKUserContentController alloc]init];
+
+    //1解决解决进入播放就横屏问题
+    NSString *jSString = @"document.getElementsByTagName('video')[0].setAttribute('playsinline','playsinline');";
+    WKUserScript *wkUserScript = [[WKUserScript alloc] initWithSource:jSString injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
+    [content addUserScript:wkUserScript];
+    
+    
+    //2,暂停播放监听
+    NSString *PausePlayListenerjSString = @"document.getElementsByTagName('video')[0].addEventListener('pause', function(e) {window.webkit.messageHandlers.pause.postMessage(\"pause\");})";
+    WKUserScript *PausePlayListenerwkUScript = [[WKUserScript alloc] initWithSource:PausePlayListenerjSString injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
+    [content addUserScript:PausePlayListenerwkUScript];
+    
+    //3,继续播放监听
+    NSString *ContinuePlayingListenerjSString = @"document.getElementsByTagName('video')[0].addEventListener('play', function(e) {window.webkit.messageHandlers.play.postMessage(\"play\");})";
+    WKUserScript *ContinuePlayingListenerwkUScript = [[WKUserScript alloc] initWithSource:ContinuePlayingListenerjSString injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
+    [content addUserScript:ContinuePlayingListenerwkUScript];
+    
+    //4,播放结束监听
+    NSString *EndOfPlayListenerjSString = @"document.getElementsByTagName('video')[0].addEventListener('ended', function(e) {window.webkit.messageHandlers.ended.postMessage(\"ended\");})";
+    WKUserScript *EndOfPlayListenerwkUScript = [[WKUserScript alloc] initWithSource:EndOfPlayListenerjSString injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:YES];
+    [content addUserScript:EndOfPlayListenerwkUScript];
+
+    //添加一个协议
+    [content addScriptMessageHandler:self name:@"play"];
+    [content addScriptMessageHandler:self name:@"pause"];
+    [content addScriptMessageHandler:self name:@"ended"];
+
+    //5,暂停播放播放
+    NSString *pauseJS = @"var videos = document.getElementsByTagName(\"video\");\
+    function pauseVideo(){videos[0].pause();}\
+    function playVideo(){videos[0].play();}";
+    
+    WKUserScript *PausePlaywkUScript = [[WKUserScript alloc] initWithSource:pauseJS injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
+    [content addUserScript:PausePlaywkUScript];
+   
+    
+    config.userContentController= content;
+    
+    _curWKWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H) configuration:config];
+    // UI代理
+    _curWKWebView.UIDelegate = self;
+    // 导航代理
+    _curWKWebView.navigationDelegate = self;
+
+    [self.view addSubview:_curWKWebView];
+    
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+    [self beginPlayVideoFun];
+}
+
+- (void)beginPlayVideoFun
+{
+    NSString *filePath = _VideoDataMode.path;
+    
+    NSString *urlStr = ksharedAppDelegate.NASFileService;
+    NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
+    fileUrl = [fileUrl  stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    
+    NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];
+    
+    // 根据URL创建请求
+//    NSURLRequest *request = [NSURLRequest requestWithURL:sourceMovieURL];
+//    [_curWKWebView loadRequest:request];
+    
+    //111111111
+    NSURL *videoUrl = sourceMovieURL;
+    AVAsset *asset = [AVAsset assetWithURL:videoUrl];
+    AVPlayerItem*videoItem = [AVPlayerItem playerItemWithAsset:asset]; // 视频资源信息 M
+    _player = [AVPlayer playerWithPlayerItem:videoItem]; // 视频控制播放层 C
+    AVPlayerLayer*playerLayer = [[AVPlayerLayer alloc]init]; // 视频展示层 V
+    playerLayer.player = _player;
+    playerLayer.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
+    [self.view.layer addSublayer:playerLayer]; // 添加到父视图的layer层
+
+    // 监听视频状态
+    [videoItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:@"item.status"];
+    // 监听缓冲进度
+    [videoItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:@"item.loaded"];
+     //获取播放进度
+    [_player addPeriodicTimeObserverForInterval:CMTimeMake(1, 1) queue:dispatch_get_main_queue() usingBlock:^(CMTime time) {
+        float startSeconds =  CMTimeGetSeconds(time); // 已经播放的秒数
+        HLog(@"22222 %f",startSeconds);
+    }];
+    
+    // 接收播放完成通知
+    //[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handlePlayEnd) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
+
+
+}
+
+
+#pragma mark 事件代理
+// 页面开始加载时调用
+-(void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
+    
+}
+// 当内容开始返回时调用
+- (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation{
+    
+}
+// 页面加载完成之后调用
+- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{//这里修改导航栏的标题,动态改变
+    
+   
+    
+}
+// 页面加载失败时调用
+- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation{
+
+    
+}
+// 接收到服务器跳转请求之后再执行
+- (void)webView:(WKWebView *)webView didReceiveServerRedirectForProvisionalNavigation:(WKNavigation *)navigation{
+    
+}
+// 在收到响应后,决定是否跳转
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler{
+    
+    HLog(@"%@",webView);
+    HLog(@"%@",navigationResponse);
+    
+    WKNavigationResponsePolicy actionPolicy = WKNavigationResponsePolicyAllow;
+    //这句是必须加上的,不然会异常
+    decisionHandler(actionPolicy);
+    
+}
+// 在发送请求之前,决定是否跳转
+- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler{
+    
+    HLog(@"URL=======%@", navigationAction.request.URL);
+    HLog(@"URL.scheme=======%@", navigationAction.request.URL.scheme);
+    
+    
+    WKNavigationActionPolicy actionPolicy = WKNavigationActionPolicyAllow;
+    
+    if (navigationAction.targetFrame == nil) {
+
+        [webView loadRequest:navigationAction.request];
+
+    }
+    if (navigationAction.navigationType==WKNavigationTypeBackForward) {//判断是返回类型
+        
+        
+    }
+    //这句是必须加上的,不然会异常
+    decisionHandler(actionPolicy);
+    
+    //NSString *url = navigationAction.request.URL.absoluteString;
+
+}
+
+
+#pragma mark - WKScriptMessageHandler
+- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
+    HLog(@"%@",NSStringFromSelector(_cmd));
+    HLog(@"%@",message);
+    HLog(@"%@",message.body);
+    HLog(@"%@",message.name);
+
+    NSString *jsonStr = message.body;  //
+    HLog(@"%@",jsonStr);
+    
+ 
+    KWeakSelf
+    if ([message.name caseInsensitiveCompare:@"play"] == NSOrderedSame) {
+        NSLog(@"video is play");
+    }
+    else if ([message.name caseInsensitiveCompare:@"pause"] == NSOrderedSame) {
+        NSLog(@"video is pause");
+    }
+    else if ([message.name caseInsensitiveCompare:@"ended"] == NSOrderedSame) {
+        NSLog(@"video is ended");
+        [weakSelf playVideo];
+    }
+
+    
+}
+
+
+#pragma mark 原生调用JS暂停
+- (void)pausePlay
+{
+    [_curWKWebView evaluateJavaScript:@"pauseVideo()" completionHandler:^(id _Nullable response, NSError * _Nullable error) {
+      NSLog(@"response:%@,error:%@",response,error);
+    }];
+}
+
+- (void)playVideo
+{
+    [_curWKWebView evaluateJavaScript:@"playVideo()" completionHandler:^(id _Nullable response, NSError * _Nullable error) {
+      NSLog(@"response:%@,error:%@",response,error);
+    }];
+}
+
+
+
+
+//通过KVO来观察status属性的变化,来获得播放之前的错误信息
+         
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context
+{
+    if ([keyPath isEqualToString:@"status"]) {
+        AVPlayerStatus status = [change[NSKeyValueChangeNewKey] intValue];
+        switch (status) {
+            case AVPlayerStatusFailed:
+            {
+                NSError *error = self.player.currentItem.error;
+                NSLog(@"url有误:%@",error);
+            }
+                break;
+            case AVPlayerStatusReadyToPlay:
+            {
+                NSLog(@"准备好播放了");
+            }
+                break;
+            case AVPlayerStatusUnknown:
+            {
+                NSLog(@"视频资源出现未知错误");
+            }
+                break;
+            default:
+                break;
+        }
+    }
+}
+
+@end

+ 34 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/ZFCustomControlView.h

@@ -0,0 +1,34 @@
+//
+//  ZFCustomControlView.h
+//  ZFPlayer_Example
+//
+//  Created by 紫枫 on 2019/6/5.
+//  Copyright © 2019 紫枫. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import <ZFPlayer/ZFPlayerMediaControl.h>
+#import "ZFSpeedLoadingView.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ZFCustomControlView : UIView <ZFPlayerMediaControl>
+
+/// 控制层自动隐藏的时间,默认2.5秒
+@property (nonatomic, assign) NSTimeInterval autoHiddenTimeInterval;
+
+/// 控制层显示、隐藏动画的时长,默认0.25秒
+@property (nonatomic, assign) NSTimeInterval autoFadeTimeInterval;
+
+/**
+ 设置标题、封面、全屏模式
+ 
+ @param title 视频的标题
+ @param coverUrl 视频的封面,占位图默认是灰色的
+ @param fullScreenMode 全屏模式
+ */
+- (void)showTitle:(NSString *)title coverURLString:(NSString *)coverUrl fullScreenMode:(ZFFullScreenMode)fullScreenMode;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 606 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/ZFCustomControlView.m

@@ -0,0 +1,606 @@
+//
+//  ZFCustomControlView.m
+//  ZFPlayer_Example
+//
+//  Created by 紫枫 on 2019/6/5.
+//  Copyright © 2019 紫枫. All rights reserved.
+//
+
+#import "ZFCustomControlView.h"
+#import "UIView+ZFFrame.h"
+#import "ZFUtilities.h"
+#import <ZFPlayer/ZFPlayerController.h>
+#import <ZFPlayer/ZFPlayerConst.h>
+#import "ZFSliderView.h"
+#import "UIImageView+ZFCache.h"
+
+@interface ZFCustomControlView () <ZFSliderViewDelegate>
+
+/// 底部工具栏
+@property (nonatomic, strong) UIView *bottomToolView;
+/// 顶部工具栏
+@property (nonatomic, strong) UIView *topToolView;
+/// 标题
+@property (nonatomic, strong) UILabel *titleLabel;
+/// 播放或暂停按钮
+@property (nonatomic, strong) UIButton *playOrPauseBtn;
+/// 播放的当前时间
+@property (nonatomic, strong) UILabel *currentTimeLabel;
+/// 滑杆
+@property (nonatomic, strong) ZFSliderView *slider;
+/// 视频总时间
+@property (nonatomic, strong) UILabel *totalTimeLabel;
+/// 全屏按钮
+@property (nonatomic, strong) UIButton *fullScreenBtn;
+
+@property (nonatomic, assign) BOOL isShow;
+
+@property (nonatomic, assign) BOOL controlViewAppeared;
+
+@property (nonatomic, strong) dispatch_block_t afterBlock;
+
+@property (nonatomic, assign) NSTimeInterval sumTime;
+
+/// 底部播放进度
+@property (nonatomic, strong) ZFSliderView *bottomPgrogress;
+
+/// 加载loading
+@property (nonatomic, strong) ZFSpeedLoadingView *activity;
+
+/// 封面图
+@property (nonatomic, strong) UIImageView *coverImageView;
+
+@end
+
+@implementation ZFCustomControlView
+@synthesize player = _player;
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        // 添加子控件
+        [self addSubview:self.topToolView];
+        [self addSubview:self.bottomToolView];
+        [self addSubview:self.playOrPauseBtn];
+        [self.topToolView addSubview:self.titleLabel];
+        [self.bottomToolView addSubview:self.currentTimeLabel];
+        [self.bottomToolView addSubview:self.slider];
+        [self.bottomToolView addSubview:self.totalTimeLabel];
+        [self.bottomToolView addSubview:self.fullScreenBtn];
+        [self addSubview:self.bottomPgrogress];
+        [self addSubview:self.activity];
+
+        self.autoFadeTimeInterval = 0.2;
+        self.autoHiddenTimeInterval = 2.5;
+
+        // 设置子控件的响应事件
+        [self makeSubViewsAction];
+        
+        [self resetControlView];
+        self.clipsToBounds = YES;
+    }
+    return self;
+}
+
+- (void)makeSubViewsAction {
+    [self.playOrPauseBtn addTarget:self action:@selector(playPauseButtonClickAction:) forControlEvents:UIControlEventTouchUpInside];
+    [self.fullScreenBtn addTarget:self action:@selector(fullScreenButtonClickAction:) forControlEvents:UIControlEventTouchUpInside];
+}
+
+#pragma mark - ZFSliderViewDelegate
+
+- (void)sliderTouchBegan:(float)value {
+    self.slider.isdragging = YES;
+}
+
+- (void)sliderTouchEnded:(float)value {
+    if (self.player.totalTime > 0) {
+        @zf_weakify(self)
+        [self.player seekToTime:self.player.totalTime*value completionHandler:^(BOOL finished) {
+            @zf_strongify(self)
+            if (finished) {
+                self.slider.isdragging = NO;
+            }
+        }];
+    } else {
+        self.slider.isdragging = NO;
+    }
+}
+
+- (void)sliderValueChanged:(float)value {
+    if (self.player.totalTime == 0) {
+        self.slider.value = 0;
+        return;
+    }
+    self.slider.isdragging = YES;
+    NSString *currentTimeString = [ZFUtilities convertTimeSecond:self.player.totalTime*value];
+    self.currentTimeLabel.text = currentTimeString;
+}
+
+- (void)sliderTapped:(float)value {
+    if (self.player.totalTime > 0) {
+        self.slider.isdragging = YES;
+        @zf_weakify(self)
+        [self.player seekToTime:self.player.totalTime*value completionHandler:^(BOOL finished) {
+            @zf_strongify(self)
+            if (finished) {
+                self.slider.isdragging = NO;
+                [self.player.currentPlayerManager play];
+            }
+        }];
+    } else {
+        self.slider.isdragging = NO;
+        self.slider.value = 0;
+    }
+}
+
+#pragma mark - action
+
+- (void)playPauseButtonClickAction:(UIButton *)sender {
+    [self playOrPause];
+}
+
+- (void)fullScreenButtonClickAction:(UIButton *)sender {
+    [self.player enterFullScreen:!self.player.isFullScreen animated:YES];
+}
+
+/// 根据当前播放状态取反
+- (void)playOrPause {
+    self.playOrPauseBtn.selected = !self.playOrPauseBtn.isSelected;
+    self.playOrPauseBtn.isSelected? [self.player.currentPlayerManager play]: [self.player.currentPlayerManager pause];
+}
+
+- (void)playBtnSelectedState:(BOOL)selected {
+    self.playOrPauseBtn.selected = selected;
+}
+
+#pragma mark - 添加子控件约束
+
+- (void)layoutSubviews {
+    [super layoutSubviews];
+    
+    CGFloat min_x = 0;
+    CGFloat min_y = 0;
+    CGFloat min_w = 0;
+    CGFloat min_h = 0;
+    CGFloat min_view_w = self.bounds.size.width;
+    CGFloat min_view_h = self.bounds.size.height;
+    CGFloat min_margin = 9;
+    
+    self.coverImageView.frame = self.bounds;
+    
+    min_w = 80;
+    min_h = 80;
+    self.activity.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    self.activity.zf_centerX = self.zf_centerX;
+    self.activity.zf_centerY = self.zf_centerY + 10;
+    
+    min_x = 0;
+    min_y = 0;
+    min_w = min_view_w;
+    min_h = (iPhoneX && self.player.isFullScreen) ? 80 : 40;
+    self.topToolView.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    
+    min_x = self.player.isFullScreen ? 40: 15;
+    min_y = 0;
+    min_w = min_view_w - min_x - 15;
+    min_h = 30;
+    self.titleLabel.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    self.titleLabel.zf_centerY = self.topToolView.zf_centerY;
+
+    min_h = (iPhoneX && self.player.isFullScreen) ? 100 : 40;
+    min_x = 0;
+    min_y = min_view_h - min_h;
+    min_w = min_view_w;
+    self.bottomToolView.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    
+    min_x = 0;
+    min_y = 0;
+    min_w = 44;
+    min_h = min_w;
+    self.playOrPauseBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    self.playOrPauseBtn.center = self.center;
+    
+    min_x = (iPhoneX && self.player.isFullScreen) ? 44: 15;
+    min_w = 62;
+    min_h = 28;
+    min_y = (self.bottomToolView.zf_height - min_h)/2;
+    self.currentTimeLabel.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    
+    min_w = 28;
+    min_h = min_w;
+    min_x = self.bottomToolView.zf_width - min_w - ((iPhoneX && self.player.isFullScreen) ? 44: min_margin);
+    min_y = 0;
+    self.fullScreenBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    self.fullScreenBtn.zf_centerY = self.currentTimeLabel.zf_centerY;
+    
+    min_w = 62;
+    min_h = 28;
+    min_x = self.fullScreenBtn.zf_left - min_w - 4;
+    min_y = 0;
+    self.totalTimeLabel.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    self.totalTimeLabel.zf_centerY = self.currentTimeLabel.zf_centerY;
+    
+    min_x = self.currentTimeLabel.zf_right + 4;
+    min_y = 0;
+    min_w = self.totalTimeLabel.zf_left - min_x - 4;
+    min_h = 30;
+    self.slider.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    self.slider.zf_centerY = self.currentTimeLabel.zf_centerY;
+    
+    min_x = 0;
+    min_y = min_view_h - 1;
+    min_w = min_view_w;
+    min_h = 1;
+    self.bottomPgrogress.frame = CGRectMake(min_x, min_y, min_w, min_h);
+    
+    if (!self.isShow) {
+        self.topToolView.zf_y = -self.topToolView.zf_height;
+        self.bottomToolView.zf_y = self.zf_height;
+        self.playOrPauseBtn.alpha = 0;
+    } else {
+        self.topToolView.zf_y = 0;
+        self.bottomToolView.zf_y = self.zf_height - self.bottomToolView.zf_height;
+        self.playOrPauseBtn.alpha = 1;
+    }
+}
+
+#pragma mark - private
+
+/** 重置ControlView */
+- (void)resetControlView {
+    self.bottomToolView.alpha        = 1;
+    self.slider.value                = 0;
+    self.slider.bufferValue          = 0;
+    self.currentTimeLabel.text       = @"00:00";
+    self.totalTimeLabel.text         = @"00:00";
+    self.backgroundColor             = [UIColor clearColor];
+    self.playOrPauseBtn.selected     = YES;
+    self.titleLabel.text             = @"";
+}
+
+- (void)showControlView {
+    self.topToolView.alpha           = 1;
+    self.bottomToolView.alpha        = 1;
+    self.isShow                      = YES;
+    self.topToolView.zf_y            = 0;
+    self.bottomToolView.zf_y         = self.zf_height - self.bottomToolView.zf_height;
+    self.playOrPauseBtn.alpha        = 1;
+    self.player.statusBarHidden      = NO;
+}
+
+- (void)hideControlView {
+    self.isShow                      = NO;
+    self.topToolView.zf_y            = -self.topToolView.zf_height;
+    self.bottomToolView.zf_y         = self.zf_height;
+    self.player.statusBarHidden      = NO;
+    self.playOrPauseBtn.alpha        = 0;
+    self.topToolView.alpha           = 0;
+    self.bottomToolView.alpha        = 0;
+}
+
+- (void)autoFadeOutControlView {
+    self.controlViewAppeared = YES;
+    [self cancelAutoFadeOutControlView];
+    @zf_weakify(self)
+    self.afterBlock = dispatch_block_create(0, ^{
+        @zf_strongify(self)
+        [self hideControlViewWithAnimated:YES];
+    });
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.autoHiddenTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(),self.afterBlock);
+}
+
+/// 取消延时隐藏controlView的方法
+- (void)cancelAutoFadeOutControlView {
+    if (self.afterBlock) {
+        dispatch_block_cancel(self.afterBlock);
+        self.afterBlock = nil;
+    }
+}
+
+/// 隐藏控制层
+- (void)hideControlViewWithAnimated:(BOOL)animated {
+    self.controlViewAppeared = NO;
+    [UIView animateWithDuration:animated ? self.autoFadeTimeInterval : 0 animations:^{
+        [self hideControlView];
+    } completion:^(BOOL finished) {
+        self.bottomPgrogress.hidden = NO;
+    }];
+}
+
+/// 显示控制层
+- (void)showControlViewWithAnimated:(BOOL)animated {
+    self.controlViewAppeared = YES;
+    [self autoFadeOutControlView];
+    [UIView animateWithDuration:animated ? self.autoFadeTimeInterval : 0 animations:^{
+        [self showControlView];
+    } completion:^(BOOL finished) {
+        self.bottomPgrogress.hidden = YES;
+    }];
+}
+
+
+- (BOOL)shouldResponseGestureWithPoint:(CGPoint)point withGestureType:(ZFPlayerGestureType)type touch:(nonnull UITouch *)touch {
+    CGRect sliderRect = [self.bottomToolView convertRect:self.slider.frame toView:self];
+    if (CGRectContainsPoint(sliderRect, point)) {
+        return NO;
+    }
+    return YES;
+}
+
+/**
+ 设置标题、封面、全屏模式
+ 
+ @param title 视频的标题
+ @param coverUrl 视频的封面,占位图默认是灰色的
+ @param fullScreenMode 全屏模式
+ */
+- (void)showTitle:(NSString *)title coverURLString:(NSString *)coverUrl fullScreenMode:(ZFFullScreenMode)fullScreenMode {
+    UIImage *placeholder = [ZFUtilities imageWithColor:[UIColor colorWithRed:220/255.0 green:220/255.0 blue:220/255.0 alpha:1] size:self.coverImageView.bounds.size];
+    [self resetControlView];
+    [self layoutIfNeeded];
+    [self setNeedsDisplay];
+    self.titleLabel.text = title;
+    self.player.orientationObserver.fullScreenMode = fullScreenMode;
+    [self.player.currentPlayerManager.view.coverImageView setImageWithURLString:coverUrl placeholder:placeholder];
+}
+
+/// 调节播放进度slider和当前时间更新
+- (void)sliderValueChanged:(CGFloat)value currentTimeString:(NSString *)timeString {
+    self.slider.value = value;
+    self.currentTimeLabel.text = timeString;
+    self.slider.isdragging = YES;
+    [UIView animateWithDuration:0.3 animations:^{
+        self.slider.sliderBtn.transform = CGAffineTransformMakeScale(1.2, 1.2);
+    }];
+}
+
+/// 滑杆结束滑动
+- (void)sliderChangeEnded {
+    self.slider.isdragging = NO;
+    [UIView animateWithDuration:0.3 animations:^{
+        self.slider.sliderBtn.transform = CGAffineTransformIdentity;
+    }];
+}
+
+#pragma mark - ZFPlayerControlViewDelegate
+
+/// 手势筛选,返回NO不响应该手势
+- (BOOL)gestureTriggerCondition:(ZFPlayerGestureControl *)gestureControl gestureType:(ZFPlayerGestureType)gestureType gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer touch:(nonnull UITouch *)touch {
+    CGPoint point = [touch locationInView:self];
+    if (self.player.isSmallFloatViewShow && !self.player.isFullScreen && gestureType != ZFPlayerGestureTypeSingleTap) {
+        return NO;
+    }
+    return [self shouldResponseGestureWithPoint:point withGestureType:gestureType touch:touch];
+}
+
+/// 单击手势事件
+- (void)gestureSingleTapped:(ZFPlayerGestureControl *)gestureControl {
+    if (!self.player) return;
+    if (self.player.isSmallFloatViewShow && !self.player.isFullScreen) {
+        [self.player enterFullScreen:YES animated:YES];
+    } else {
+        if (self.controlViewAppeared) {
+            [self hideControlViewWithAnimated:YES];
+        } else {
+            /// 显示之前先把控制层复位,先隐藏后显示
+            [self hideControlViewWithAnimated:NO];
+            [self showControlViewWithAnimated:YES];
+        }
+    }
+}
+
+/// 双击手势事件
+- (void)gestureDoubleTapped:(ZFPlayerGestureControl *)gestureControl {
+    [self playOrPause];
+}
+
+/// 捏合手势事件,这里改变了视频的填充模式
+- (void)gesturePinched:(ZFPlayerGestureControl *)gestureControl scale:(float)scale {
+    if (scale > 1) {
+        self.player.currentPlayerManager.scalingMode = ZFPlayerScalingModeAspectFill;
+    } else {
+        self.player.currentPlayerManager.scalingMode = ZFPlayerScalingModeAspectFit;
+    }
+}
+
+/// 准备播放
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer prepareToPlay:(NSURL *)assetURL {
+    [self hideControlViewWithAnimated:NO];
+}
+
+/// 播放状态改变
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state {
+    if (state == ZFPlayerPlayStatePlaying) {
+        [self playBtnSelectedState:YES];
+        /// 开始播放时候判断是否显示loading
+        if (videoPlayer.currentPlayerManager.loadState == ZFPlayerLoadStateStalled) {
+            [self.activity startAnimating];
+        } else if ((videoPlayer.currentPlayerManager.loadState == ZFPlayerLoadStateStalled || videoPlayer.currentPlayerManager.loadState == ZFPlayerLoadStatePrepare)) {
+            [self.activity startAnimating];
+        }
+    } else if (state == ZFPlayerPlayStatePaused) {
+        [self playBtnSelectedState:NO];
+        /// 暂停的时候隐藏loading
+        [self.activity stopAnimating];
+    } else if (state == ZFPlayerPlayStatePlayFailed) {
+        [self.activity stopAnimating];
+    }
+}
+
+/// 加载状态改变
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer loadStateChanged:(ZFPlayerLoadState)state {
+    if (state == ZFPlayerLoadStatePrepare) {
+        self.coverImageView.hidden = NO;
+    } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) {
+        self.coverImageView.hidden = YES;
+        self.player.currentPlayerManager.view.backgroundColor = [UIColor blackColor];
+    }
+    if (state == ZFPlayerLoadStateStalled && videoPlayer.currentPlayerManager.isPlaying) {
+        [self.activity startAnimating];
+    } else if ((state == ZFPlayerLoadStateStalled || state == ZFPlayerLoadStatePrepare) && videoPlayer.currentPlayerManager.isPlaying) {
+        [self.activity startAnimating];
+    } else {
+        [self.activity stopAnimating];
+    }
+}
+
+/// 播放进度改变回调
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer currentTime:(NSTimeInterval)currentTime totalTime:(NSTimeInterval)totalTime {
+    if (!self.slider.isdragging) {
+        NSString *currentTimeString = [ZFUtilities convertTimeSecond:currentTime];
+        self.currentTimeLabel.text = currentTimeString;
+        NSString *totalTimeString = [ZFUtilities convertTimeSecond:totalTime];
+        self.totalTimeLabel.text = totalTimeString;
+        self.slider.value = videoPlayer.progress;
+    }
+    self.bottomPgrogress.value = videoPlayer.progress;
+}
+
+/// 缓冲改变回调
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer bufferTime:(NSTimeInterval)bufferTime {
+    self.slider.bufferValue = videoPlayer.bufferProgress;
+    self.bottomPgrogress.bufferValue = videoPlayer.bufferProgress;
+}
+
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer presentationSizeChanged:(CGSize)size {
+    
+}
+
+/// 视频view即将旋转
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer orientationWillChange:(ZFOrientationObserver *)observer {
+    if (videoPlayer.isSmallFloatViewShow) {
+        if (observer.isFullScreen) {
+            self.controlViewAppeared = NO;
+            [self cancelAutoFadeOutControlView];
+        }
+    }
+    if (self.controlViewAppeared) {
+        [self showControlViewWithAnimated:NO];
+    } else {
+        [self hideControlViewWithAnimated:NO];
+    }
+}
+
+/// 视频view已经旋转
+- (void)videoPlayer:(ZFPlayerController *)videoPlayer orientationDidChanged:(ZFOrientationObserver *)observer {
+    if (self.controlViewAppeared) {
+        [self showControlViewWithAnimated:NO];
+    } else {
+        [self hideControlViewWithAnimated:NO];
+    }
+    [self layoutIfNeeded];
+    [self setNeedsDisplay];
+}
+
+/// 锁定旋转方向
+- (void)lockedVideoPlayer:(ZFPlayerController *)videoPlayer lockedScreen:(BOOL)locked {
+    [self showControlViewWithAnimated:YES];
+}
+
+#pragma mark - setter
+
+- (void)setPlayer:(ZFPlayerController *)player {
+    _player = player;
+}
+
+#pragma mark - getter
+
+- (UIView *)topToolView {
+    if (!_topToolView) {
+        _topToolView = [[UIView alloc] init];
+        UIImage *image = ZFPlayer_Image(@"ZFPlayer_top_shadow");
+        _topToolView.layer.contents = (id)image.CGImage;
+    }
+    return _topToolView;
+}
+
+- (UILabel *)titleLabel {
+    if (!_titleLabel) {
+        _titleLabel = [[UILabel alloc] init];
+        _titleLabel.textColor = [UIColor whiteColor];
+        _titleLabel.font = [UIFont systemFontOfSize:15.0];
+    }
+    return _titleLabel;
+}
+
+- (UIView *)bottomToolView {
+    if (!_bottomToolView) {
+        _bottomToolView = [[UIView alloc] init];
+        UIImage *image = ZFPlayer_Image(@"ZFPlayer_bottom_shadow");
+        _bottomToolView.layer.contents = (id)image.CGImage;
+    }
+    return _bottomToolView;
+}
+
+- (UIButton *)playOrPauseBtn {
+    if (!_playOrPauseBtn) {
+        _playOrPauseBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_playOrPauseBtn setImage:ZFPlayer_Image(@"new_allPlay_44x44_") forState:UIControlStateNormal];
+        [_playOrPauseBtn setImage:ZFPlayer_Image(@"new_allPause_44x44_") forState:UIControlStateSelected];
+    }
+    return _playOrPauseBtn;
+}
+
+- (UILabel *)currentTimeLabel {
+    if (!_currentTimeLabel) {
+        _currentTimeLabel = [[UILabel alloc] init];
+        _currentTimeLabel.textColor = [UIColor whiteColor];
+        _currentTimeLabel.font = [UIFont systemFontOfSize:14.0f];
+        _currentTimeLabel.textAlignment = NSTextAlignmentCenter;
+    }
+    return _currentTimeLabel;
+}
+
+- (ZFSliderView *)slider {
+    if (!_slider) {
+        _slider = [[ZFSliderView alloc] init];
+        _slider.delegate = self;
+        _slider.maximumTrackTintColor = [UIColor colorWithRed:0.5 green:0.5 blue:0.5 alpha:0.8];
+        _slider.bufferTrackTintColor  = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5];
+        _slider.minimumTrackTintColor = [UIColor whiteColor];
+        [_slider setThumbImage:ZFPlayer_Image(@"ZFPlayer_slider") forState:UIControlStateNormal];
+        _slider.sliderHeight = 2;
+    }
+    return _slider;
+}
+
+- (UILabel *)totalTimeLabel {
+    if (!_totalTimeLabel) {
+        _totalTimeLabel = [[UILabel alloc] init];
+        _totalTimeLabel.textColor = [UIColor whiteColor];
+        _totalTimeLabel.font = [UIFont systemFontOfSize:14.0f];
+        _totalTimeLabel.textAlignment = NSTextAlignmentCenter;
+    }
+    return _totalTimeLabel;
+}
+
+- (UIButton *)fullScreenBtn {
+    if (!_fullScreenBtn) {
+        _fullScreenBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+        [_fullScreenBtn setImage:ZFPlayer_Image(@"ZFPlayer_fullscreen") forState:UIControlStateNormal];
+    }
+    return _fullScreenBtn;
+}
+
+- (UIImageView *)coverImageView {
+    if (!_coverImageView) {
+        _coverImageView = [[UIImageView alloc] init];
+        _coverImageView.userInteractionEnabled = YES;
+        _coverImageView.contentMode = UIViewContentModeScaleAspectFit;
+    }
+    return _coverImageView;
+}
+
+- (ZFSliderView *)bottomPgrogress {
+    if (!_bottomPgrogress) {
+        _bottomPgrogress = [[ZFSliderView alloc] init];
+        _bottomPgrogress.maximumTrackTintColor = [UIColor clearColor];
+        _bottomPgrogress.minimumTrackTintColor = [UIColor whiteColor];
+        _bottomPgrogress.bufferTrackTintColor  = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.5];
+        _bottomPgrogress.sliderHeight = 1;
+        _bottomPgrogress.isHideSliderBlock = NO;
+    }
+    return _bottomPgrogress;
+}
+
+@end

+ 61 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/Root.plist

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>StringsTable</key>
+	<string>Root</string>
+	<key>PreferenceSpecifiers</key>
+	<array>
+		<dict>
+			<key>Type</key>
+			<string>PSGroupSpecifier</string>
+			<key>Title</key>
+			<string>Group</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>PSTextFieldSpecifier</string>
+			<key>Title</key>
+			<string>Name</string>
+			<key>Key</key>
+			<string>name_preference</string>
+			<key>DefaultValue</key>
+			<string></string>
+			<key>IsSecure</key>
+			<false/>
+			<key>KeyboardType</key>
+			<string>Alphabet</string>
+			<key>AutocapitalizationType</key>
+			<string>None</string>
+			<key>AutocorrectionType</key>
+			<string>No</string>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>PSToggleSwitchSpecifier</string>
+			<key>Title</key>
+			<string>Enabled</string>
+			<key>Key</key>
+			<string>enabled_preference</string>
+			<key>DefaultValue</key>
+			<true/>
+		</dict>
+		<dict>
+			<key>Type</key>
+			<string>PSSliderSpecifier</string>
+			<key>Key</key>
+			<string>slider_preference</string>
+			<key>DefaultValue</key>
+			<real>0.5</real>
+			<key>MinimumValue</key>
+			<integer>0</integer>
+			<key>MaximumValue</key>
+			<integer>1</integer>
+			<key>MinimumValueImage</key>
+			<string></string>
+			<key>MaximumValueImage</key>
+			<string></string>
+		</dict>
+	</array>
+</dict>
+</plist>

BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/en.lproj/Root.strings


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_pause@2x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_pause@3x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play@2x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play@3x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play_hl@2x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/icon_play_hl@3x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/quanping@2x.png


BIN
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.bundle/images/quanping@3x.png


+ 45 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.h

@@ -0,0 +1,45 @@
+//
+//  TBPlayer.h
+//  TBPlayer
+//
+//  Created by qianjianeng on 16/1/31.
+//  Copyright © 2016年 SF. All rights reserved.
+//// github地址:https://github.com/suifengqjn/TBPlayer
+
+
+#import <AVFoundation/AVFoundation.h>
+#import <UIKit/UIKit.h>
+
+FOUNDATION_EXPORT NSString *const kTBPlayerStateChangedNotification;
+FOUNDATION_EXPORT NSString *const kTBPlayerProgressChangedNotification;
+FOUNDATION_EXPORT NSString *const kTBPlayerLoadProgressChangedNotification;
+
+//播放器的几种状态
+typedef NS_ENUM(NSInteger, TBPlayerState) {
+    TBPlayerStateBuffering = 1,
+    TBPlayerStatePlaying   = 2,
+    TBPlayerStateStopped   = 3,
+    TBPlayerStatePause     = 4
+};
+
+@interface TBPlayer : NSObject
+
+@property (nonatomic, readonly) TBPlayerState state;
+@property (nonatomic, readonly) CGFloat       loadedProgress;   //缓冲进度
+@property (nonatomic, readonly) CGFloat       duration;         //视频总时间
+@property (nonatomic, readonly) CGFloat       current;          //当前播放时间
+@property (nonatomic, readonly) CGFloat       progress;         //播放进度 0~1
+@property (nonatomic          ) BOOL          stopWhenAppDidEnterBackground;// default is YES
+
+
++ (instancetype)sharedInstance;
+- (void)playWithUrl:(NSURL *)url showView:(UIView *)showView;
+- (void)seekToTime:(CGFloat)seconds;
+
+- (void)resume;
+- (void)pause;
+- (void)stop;
+
+- (void)fullScreen;  //全屏
+- (void)halfScreen;   //半屏
+@end

+ 648 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBPlayer.m

@@ -0,0 +1,648 @@
+//
+//  TBPlayer.m
+//  TBPlayer
+//
+//  Created by qianjianeng on 16/1/31.
+//  Copyright © 2016年 SF. All rights reserved.
+//
+//// github地址:https://github.com/suifengqjn/TBPlayer
+
+#import "TBPlayer.h"
+#import "TBloaderURLConnection.h"
+#import "TBVideoRequestTask.h"
+#import "XCHudHelper.h"
+#define kScreenHeight ([UIScreen mainScreen].bounds.size.height)
+#define kScreenWidth ([UIScreen mainScreen].bounds.size.width)
+#define IOS_VERSION  ([[[UIDevice currentDevice] systemVersion] floatValue])
+NSString *const kTBPlayerStateChangedNotification    = @"TBPlayerStateChangedNotification";
+NSString *const kTBPlayerProgressChangedNotification = @"TBPlayerProgressChangedNotification";
+NSString *const kTBPlayerLoadProgressChangedNotification = @"TBPlayerLoadProgressChangedNotification";
+
+
+@interface TBPlayer ()<TBloaderURLConnectionDelegate>
+
+@property (nonatomic        ) TBPlayerState  state;
+@property (nonatomic        ) CGFloat        loadedProgress;//缓冲进度
+@property (nonatomic        ) CGFloat        duration;//视频总时间
+@property (nonatomic        ) CGFloat        current;//当前播放时间
+
+@property (nonatomic, strong) AVURLAsset     *videoURLAsset;
+@property (nonatomic, strong) AVAsset        *videoAsset;
+@property (nonatomic, strong) TBloaderURLConnection *resouerLoader;
+@property (nonatomic, strong) AVPlayer       *player;
+@property (nonatomic, strong) AVPlayerItem   *currentPlayerItem;
+@property (nonatomic, strong) AVPlayerLayer  *currentPlayerLayer;
+@property (nonatomic, strong) NSObject       *playbackTimeObserver;
+@property (nonatomic        ) BOOL           isPauseByUser; //是否被用户暂停
+@property (nonatomic,       ) BOOL           isLocalVideo; //是否播放本地文件
+@property (nonatomic,       ) BOOL           isFinishLoad; //是否下载完毕
+
+@property (nonatomic, weak)   UIView         *showView;
+
+@property (nonatomic, strong) UIView         *navBar;
+@property (nonatomic, strong) UILabel        *currentTimeLabel;
+@property (nonatomic, strong) UILabel        *totolTimeLabel;
+@property (nonatomic, strong) UIProgressView *videoProgressView;  //缓冲进度条
+@property (nonatomic, strong) UISlider       *playSlider;  //滑竿
+@property (nonatomic, strong) UIButton       *stopButton;//播放暂停按钮
+@property (nonatomic, strong) UIButton       *screenBUtton;//全屏按钮
+@property (nonatomic, assign) BOOL           isFullScreen;
+
+@end
+
+@implementation TBPlayer
+
++ (instancetype)sharedInstance {
+    static dispatch_once_t onceToken;
+    static id _sInstance;
+    dispatch_once(&onceToken, ^{
+        _sInstance = [[self alloc] init];
+    });
+    
+    return _sInstance;
+}
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _isPauseByUser = YES;
+        _loadedProgress = 0;
+        _duration = 0;
+        _current  = 0;
+        _state = TBPlayerStateStopped;
+        _stopWhenAppDidEnterBackground = YES;
+    }
+    return self;
+}
+
+//清空播放器监听属性
+- (void)releasePlayer
+{
+    if (!self.currentPlayerItem) {
+        return;
+    }
+    
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+    [self.currentPlayerItem removeObserver:self forKeyPath:@"status"];
+    [self.currentPlayerItem removeObserver:self forKeyPath:@"loadedTimeRanges"];
+    [self.currentPlayerItem removeObserver:self forKeyPath:@"playbackBufferEmpty"];
+    [self.currentPlayerItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"];
+    [self.player removeTimeObserver:self.playbackTimeObserver];
+    self.playbackTimeObserver = nil;
+    self.currentPlayerItem = nil;
+}
+
+- (void)playWithUrl:(NSURL *)url showView:(UIView *)showView
+{
+    
+    [self.player pause];
+    [self releasePlayer];
+    self.isPauseByUser = NO;
+    self.loadedProgress = 0;
+    self.duration = 0;
+    self.current  = 0;
+    
+    _showView = showView;
+    
+    NSString *str = [url absoluteString];
+    //如果是ios  < 7 或者是本地资源,直接播放
+    if (IOS_VERSION < 7.0 || ![str hasPrefix:@"http"]) {
+        self.videoAsset  = [AVURLAsset URLAssetWithURL:url options:nil];
+        self.currentPlayerItem          = [AVPlayerItem playerItemWithAsset:_videoAsset];
+        if (!self.player) {
+            self.player = [AVPlayer playerWithPlayerItem:self.currentPlayerItem];
+        } else {
+            [self.player replaceCurrentItemWithPlayerItem:self.currentPlayerItem];
+        }
+        self.currentPlayerLayer       = [AVPlayerLayer playerLayerWithPlayer:self.player];
+        self.currentPlayerLayer.frame = CGRectMake(0, 44, showView.bounds.size.width, showView.bounds.size.height-44);
+        _isLocalVideo = YES;
+        
+    } else {   //ios7以上采用resourceLoader给播放器补充数据
+        
+        self.resouerLoader          = [[TBloaderURLConnection alloc] init];
+        self.resouerLoader.delegate = self;
+        NSURL *playUrl              = [_resouerLoader getSchemeVideoURL:url];
+        self.videoURLAsset             = [AVURLAsset URLAssetWithURL:playUrl options:nil];
+        [_videoURLAsset.resourceLoader setDelegate:_resouerLoader queue:dispatch_get_main_queue()];
+        self.currentPlayerItem          = [AVPlayerItem playerItemWithAsset:_videoURLAsset];
+        
+        if (!self.player) {
+            self.player = [AVPlayer playerWithPlayerItem:self.currentPlayerItem];
+        } else {
+            [self.player replaceCurrentItemWithPlayerItem:self.currentPlayerItem];
+        }
+        self.currentPlayerLayer       = [AVPlayerLayer playerLayerWithPlayer:self.player];
+        self.currentPlayerLayer.frame = CGRectMake(0, 44, showView.bounds.size.width, showView.bounds.size.height-44);
+        _isLocalVideo = NO;
+        
+    }
+    
+    [showView.layer addSublayer:self.currentPlayerLayer];
+
+    [self.currentPlayerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
+    [self.currentPlayerItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:nil];
+    [self.currentPlayerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:nil];
+    [self.currentPlayerItem addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:NSKeyValueObservingOptionNew context:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterBackground) name:UIApplicationWillResignActiveNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterPlayGround) name:UIApplicationDidBecomeActiveNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemDidPlayToEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.currentPlayerItem];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemPlaybackStalled:) name:AVPlayerItemPlaybackStalledNotification object:self.currentPlayerItem];
+
+    
+    // 本地文件不设置TBPlayerStateBuffering状态
+    if ([url.scheme isEqualToString:@"file"]) {
+        
+        // 如果已经在TBPlayerStatePlaying,则直接发通知,否则设置状态
+        if (self.state == TBPlayerStatePlaying) {
+            [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerStateChangedNotification object:nil];
+        } else {
+            self.state = TBPlayerStatePlaying;
+        }
+        
+    } else {
+        
+        // 如果已经在TBPlayerStateBuffering,则直接发通知,否则设置状态
+        if (self.state == TBPlayerStateBuffering) {
+            [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerStateChangedNotification object:nil];
+        } else {
+            self.state = TBPlayerStateBuffering;
+        }
+        
+    }
+    
+
+    if (!_navBar) {
+        _navBar = [[UIView alloc] init];
+        [showView addSubview:_navBar];
+    }
+    [self buildVideoNavBar];
+    
+    [[XCHudHelper sharedInstance] showHudOnView:_showView caption:nil image:nil acitivity:YES autoHideTime:0];
+    
+    [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerProgressChangedNotification object:nil];
+    
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(halfScreen)];
+    
+    [showView addGestureRecognizer:tap];
+}
+
+
+- (void)fullScreen
+{
+    _navBar.hidden = YES;
+    self.currentPlayerLayer.transform = CATransform3DMakeRotation(M_PI/2, 0, 0, 1);
+    self.currentPlayerLayer.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
+}
+
+- (void)halfScreen
+{
+    _navBar.hidden = NO;
+    self.currentPlayerLayer.transform = CATransform3DIdentity;
+    self.currentPlayerLayer.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight);
+}
+
+- (void)seekToTime:(CGFloat)seconds
+{
+    if (self.state == TBPlayerStateStopped) {
+        return;
+    }
+    
+    seconds = MAX(0, seconds);
+    seconds = MIN(seconds, self.duration);
+    
+    [self.player pause];
+    [self.player seekToTime:CMTimeMakeWithSeconds(seconds, NSEC_PER_SEC) completionHandler:^(BOOL finished) {
+        self.isPauseByUser = NO;
+        [self.player play];
+        if (!self.currentPlayerItem.isPlaybackLikelyToKeepUp) {
+            self.state = TBPlayerStateBuffering;
+            [[XCHudHelper sharedInstance] showHudOnView:_showView caption:nil image:nil acitivity:YES autoHideTime:0];
+        }
+        
+    }];
+}
+
+- (void)resumeOrPause
+{
+    if (!self.currentPlayerItem) {
+        return;
+    }
+    if (self.state == TBPlayerStatePlaying) {
+        [_stopButton setImage:[self imageNamed:@"icon_play"] forState:UIControlStateNormal];
+        [_stopButton setImage:[self imageNamed:@"icon_play_hl"] forState:UIControlStateHighlighted];
+        [self.player pause];
+        self.state = TBPlayerStatePause;
+    } else if (self.state == TBPlayerStatePause) {
+        [_stopButton setImage:[self imageNamed:@"icon_pause"] forState:UIControlStateNormal];
+        [_stopButton setImage:[self imageNamed:@"icon_pause_hl"] forState:UIControlStateHighlighted];
+        [self.player play];
+        self.state = TBPlayerStatePlaying;
+    }
+    self.isPauseByUser = YES;
+}
+
+- (void)resume
+{
+    if (!self.currentPlayerItem) {
+        return;
+    }
+    
+    [_stopButton setImage:[self imageNamed:@"icon_pause"] forState:UIControlStateNormal];
+    [_stopButton setImage:[self imageNamed:@"icon_pause_hl"] forState:UIControlStateHighlighted];
+    self.isPauseByUser = NO;
+    [self.player play];
+}
+
+- (void)pause
+{
+    if (!self.currentPlayerItem) {
+        return;
+    }
+    [_stopButton setImage:[self imageNamed:@"icon_play"] forState:UIControlStateNormal];
+    [_stopButton setImage:[self imageNamed:@"icon_play_hl"] forState:UIControlStateHighlighted];
+    self.isPauseByUser = YES;
+    self.state = TBPlayerStatePause;
+    [self.player pause];
+}
+
+- (void)stop
+{
+    self.isPauseByUser = YES;
+    self.loadedProgress = 0;
+    self.duration = 0;
+    self.current  = 0;
+    self.state = TBPlayerStateStopped;
+    [self.player pause];
+    [self releasePlayer];
+    [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerProgressChangedNotification object:nil];
+}
+
+
+- (CGFloat)progress
+{
+    if (self.duration > 0) {
+        return self.current / self.duration;
+    }
+    
+    return 0;
+}
+
+
+#pragma mark - observer
+
+- (void)appDidEnterBackground
+{
+    if (self.stopWhenAppDidEnterBackground) {
+        [self pause];
+        self.state = TBPlayerStatePause;
+        self.isPauseByUser = NO;
+    }
+}
+- (void)appDidEnterPlayGround
+{
+    if (!self.isPauseByUser) {
+        [self resume];
+        self.state = TBPlayerStatePlaying;
+    }
+}
+
+- (void)playerItemDidPlayToEnd:(NSNotification *)notification
+{
+    [self stop];
+}
+
+//在监听播放器状态中处理比较准确
+- (void)playerItemPlaybackStalled:(NSNotification *)notification
+{
+    // 这里网络不好的时候,就会进入,不做处理,会在playbackBufferEmpty里面缓存之后重新播放
+    NSLog(@"buffing-----buffing");
+}
+
+- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+    AVPlayerItem *playerItem = (AVPlayerItem *)object;
+    
+    if ([keyPath isEqualToString:@"status"]) {
+        if ([playerItem status] == AVPlayerStatusReadyToPlay) {
+            [self monitoringPlayback:playerItem];// 给播放器添加计时器
+            
+        } else if ([playerItem status] == AVPlayerStatusFailed || [playerItem status] == AVPlayerStatusUnknown) {
+            [self stop];
+        }
+        
+    } else if ([keyPath isEqualToString:@"loadedTimeRanges"]) {  //监听播放器的下载进度
+        
+        [self calculateDownloadProgress:playerItem];
+        
+    } else if ([keyPath isEqualToString:@"playbackBufferEmpty"]) { //监听播放器在缓冲数据的状态
+        [[XCHudHelper sharedInstance] showHudOnView:_showView caption:nil image:nil acitivity:YES autoHideTime:0];
+        if (playerItem.isPlaybackBufferEmpty) {
+            self.state = TBPlayerStateBuffering;
+            [self bufferingSomeSecond];
+        }
+    }
+}
+
+- (void)monitoringPlayback:(AVPlayerItem *)playerItem
+{
+    
+    
+    self.duration = playerItem.duration.value / playerItem.duration.timescale; //视频总时间
+    [self.player play];
+    [self updateTotolTime:self.duration];
+    [self setPlaySliderValue:self.duration];
+    
+    __weak __typeof(self)weakSelf = self;
+    self.playbackTimeObserver = [self.player addPeriodicTimeObserverForInterval:CMTimeMake(1, 1) queue:NULL usingBlock:^(CMTime time) {
+        
+        __strong __typeof(weakSelf)strongSelf = weakSelf;
+        CGFloat current = playerItem.currentTime.value/playerItem.currentTime.timescale;
+        [strongSelf updateCurrentTime:current];
+        [strongSelf updateVideoSlider:current];
+        if (strongSelf.isPauseByUser == NO) {
+            strongSelf.state = TBPlayerStatePlaying;
+        }
+        
+        // 不相等的时候才更新,并发通知,否则seek时会继续跳动
+        if (strongSelf.current != current) {
+            strongSelf.current = current;
+            if (strongSelf.current > strongSelf.duration) {
+                strongSelf.duration = strongSelf.current;
+            }
+            [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerProgressChangedNotification object:nil];
+        }
+        
+    }];
+
+}
+
+- (void)calculateDownloadProgress:(AVPlayerItem *)playerItem
+{
+    NSArray *loadedTimeRanges = [playerItem loadedTimeRanges];
+    CMTimeRange timeRange = [loadedTimeRanges.firstObject CMTimeRangeValue];// 获取缓冲区域
+    float startSeconds = CMTimeGetSeconds(timeRange.start);
+    float durationSeconds = CMTimeGetSeconds(timeRange.duration);
+    NSTimeInterval timeInterval = startSeconds + durationSeconds;// 计算缓冲总进度
+    CMTime duration = playerItem.duration;
+    CGFloat totalDuration = CMTimeGetSeconds(duration);
+    self.loadedProgress = timeInterval / totalDuration;
+    [self.videoProgressView setProgress:timeInterval / totalDuration animated:YES];
+}
+- (void)bufferingSomeSecond
+{
+    // playbackBufferEmpty会反复进入,因此在bufferingOneSecond延时播放执行完之前再调用bufferingSomeSecond都忽略
+    static BOOL isBuffering = NO;
+    if (isBuffering) {
+        return;
+    }
+    isBuffering = YES;
+    
+    // 需要先暂停一小会之后再播放,否则网络状况不好的时候时间在走,声音播放不出来
+    [self.player pause];
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+        
+        // 如果此时用户已经暂停了,则不再需要开启播放了
+        if (self.isPauseByUser) {
+            isBuffering = NO;
+            return;
+        }
+        
+        [self.player play];
+        // 如果执行了play还是没有播放则说明还没有缓存好,则再次缓存一段时间
+        isBuffering = NO;
+        if (!self.currentPlayerItem.isPlaybackLikelyToKeepUp) {
+            [self bufferingSomeSecond];
+        }
+    });
+}
+
+- (void)setLoadedProgress:(CGFloat)loadedProgress
+{
+    if (_loadedProgress == loadedProgress) {
+        return;
+    }
+    
+    _loadedProgress = loadedProgress;
+    [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerLoadProgressChangedNotification object:nil];
+}
+
+- (void)setState:(TBPlayerState)state
+{
+    if (state != TBPlayerStateBuffering) {
+        [[XCHudHelper sharedInstance] hideHud];
+    }
+
+    if (_state == state) {
+        return;
+    }
+    
+    _state = state;
+    [[NSNotificationCenter defaultCenter] postNotificationName:kTBPlayerStateChangedNotification object:nil];
+    
+}
+
+#pragma mark - UI界面
+- (void)buildVideoNavBar
+{
+    _navBar.backgroundColor = [self colorWithHex:0x000000 alpha:0.5];
+    _navBar.frame = CGRectMake(0, 0, kScreenWidth, 44);
+    
+    
+    
+    //当前时间
+    if (!self.currentTimeLabel) {
+        self.currentTimeLabel = [[UILabel alloc] init];
+        _currentTimeLabel.textColor = [self colorWithHex:0xffffff alpha:1.0];
+        _currentTimeLabel.font = [UIFont systemFontOfSize:10.0];
+        _currentTimeLabel.frame = CGRectMake(30, 0, 52, 44);
+        _currentTimeLabel.textAlignment = NSTextAlignmentRight;
+        [_navBar addSubview:_currentTimeLabel];
+    }
+    
+    
+    //总时间
+    if (!self.totolTimeLabel) {
+        self.totolTimeLabel = [[UILabel alloc] init];
+        _totolTimeLabel.textColor = [self colorWithHex:0xffffff alpha:1.0];
+        _totolTimeLabel.font = [UIFont systemFontOfSize:10.0];
+        _totolTimeLabel.frame = CGRectMake(kScreenWidth-52-15, 0, 52, 44);
+        _totolTimeLabel.textAlignment = NSTextAlignmentLeft;
+        [_navBar addSubview:_totolTimeLabel];
+    }
+    
+    
+    //进度条
+    if (!self.videoProgressView) {
+        self.videoProgressView = [[UIProgressView alloc] init];
+        _videoProgressView.progressTintColor = [self colorWithHex:0xffffff alpha:1.0];  //填充部分颜色
+        _videoProgressView.trackTintColor = [self colorWithHex:0xffffff alpha:0.18];   // 未填充部分颜色
+        _videoProgressView.frame = CGRectMake(62+30, 21, kScreenWidth-124-44, 20);
+        _videoProgressView.layer.cornerRadius = 1.5;
+        _videoProgressView.layer.masksToBounds = YES;
+        CGAffineTransform transform = CGAffineTransformMakeScale(1.0, 1.5);
+        _videoProgressView.transform = transform;
+        [_navBar addSubview:_videoProgressView];
+    }
+    
+    
+    //滑竿
+    if (!self.playSlider) {
+        
+        self.playSlider = [[UISlider alloc] init];
+        _playSlider.frame = CGRectMake(62+30, 0, kScreenWidth-124-44, 44);
+        [_playSlider setThumbImage:[self imageNamed:@"icon_progress"] forState:UIControlStateNormal];
+        _playSlider.minimumTrackTintColor = [UIColor clearColor];
+        _playSlider.maximumTrackTintColor = [UIColor clearColor];
+        [_playSlider addTarget:self action:@selector(playSliderChange:) forControlEvents:UIControlEventValueChanged]; //拖动滑竿更新时间
+        [_playSlider addTarget:self action:@selector(playSliderChangeEnd:) forControlEvents:UIControlEventTouchUpInside];  //松手,滑块拖动停止
+        [_playSlider addTarget:self action:@selector(playSliderChangeEnd:) forControlEvents:UIControlEventTouchUpOutside];
+        [_playSlider addTarget:self action:@selector(playSliderChangeEnd:) forControlEvents:UIControlEventTouchCancel];
+        
+        [_navBar addSubview:_playSlider];
+    }
+    
+    //暂停按钮
+    if (!self.stopButton) {
+        self.stopButton = [UIButton buttonWithType:UIButtonTypeCustom];
+        _stopButton.frame = CGRectMake(0, 0, 44, 44);
+        [_stopButton addTarget:self action:@selector(resumeOrPause) forControlEvents:UIControlEventTouchUpInside];
+        [_stopButton setImage:[self imageNamed:@"icon_pause"] forState:UIControlStateNormal];
+        [_stopButton setImage:[self imageNamed:@"icon_pause_hl"] forState:UIControlStateHighlighted];
+        [_navBar addSubview:_stopButton];
+    }
+    
+    //全屏按钮
+    if (!self.screenBUtton) {
+        self.screenBUtton = [[UIButton alloc] init];
+        _screenBUtton.frame = CGRectMake(kScreenWidth - 40, 0, 44, 44);
+        [_screenBUtton addTarget:self action:@selector(fullScreen) forControlEvents:UIControlEventTouchUpInside];
+        [_screenBUtton setImage:[self imageNamed:@"quanping"] forState:UIControlStateNormal];
+        [_screenBUtton setImage:[self imageNamed:@"quanping"] forState:UIControlStateHighlighted];
+        [_navBar addSubview:_screenBUtton];
+    }
+    
+}
+
+
+//手指结束拖动,播放器从当前点开始播放,开启滑竿的时间走动
+- (void)playSliderChangeEnd:(UISlider *)slider
+{
+    [self seekToTime:slider.value];
+    [self updateCurrentTime:slider.value];
+    [_stopButton setImage:[self imageNamed:@"icon_pause"] forState:UIControlStateNormal];
+    [_stopButton setImage:[self imageNamed:@"icon_pause_hl"] forState:UIControlStateHighlighted];
+}
+
+//手指正在拖动,播放器继续播放,但是停止滑竿的时间走动
+- (void)playSliderChange:(UISlider *)slider
+{
+    [self updateCurrentTime:slider.value];
+}
+
+#pragma mark - 控件拖动
+- (void)setPlaySliderValue:(CGFloat)time
+{
+    _playSlider.minimumValue = 0.0;
+    _playSlider.maximumValue = (NSInteger)time;
+}
+- (void)updateCurrentTime:(CGFloat)time
+{
+    long videocurrent = ceil(time);
+    
+    NSString *str = nil;
+    if (videocurrent < 3600) {
+        str =  [NSString stringWithFormat:@"%02li:%02li",lround(floor(videocurrent/60.f)),lround(floor(videocurrent/1.f))%60];
+    } else {
+        str =  [NSString stringWithFormat:@"%02li:%02li:%02li",lround(floor(videocurrent/3600.f)),lround(floor(videocurrent%3600)/60.f),lround(floor(videocurrent/1.f))%60];
+    }
+    
+    _currentTimeLabel.text = str;
+}
+
+- (void)updateTotolTime:(CGFloat)time
+{
+    long videoLenth = ceil(time);
+    NSString *strtotol = nil;
+    if (videoLenth < 3600) {
+        strtotol =  [NSString stringWithFormat:@"%02li:%02li",lround(floor(videoLenth/60.f)),lround(floor(videoLenth/1.f))%60];
+    } else {
+        strtotol =  [NSString stringWithFormat:@"%02li:%02li:%02li",lround(floor(videoLenth/3600.f)),lround(floor(videoLenth%3600)/60.f),lround(floor(videoLenth/1.f))%60];
+    }
+    
+    _totolTimeLabel.text = strtotol;
+}
+
+
+- (void)updateVideoSlider:(CGFloat)currentSecond {
+    [self.playSlider setValue:currentSecond animated:YES];
+}
+
+
+#pragma mark - TBloaderURLConnectionDelegate
+
+- (void)didFinishLoadingWithTask:(TBVideoRequestTask *)task
+{
+    _isFinishLoad = task.isFinishLoad;
+}
+
+//网络中断:-1005
+//无网络连接:-1009
+//请求超时:-1001
+//服务器内部错误:-1004
+//找不到服务器:-1003
+- (void)didFailLoadingWithTask:(TBVideoRequestTask *)task WithError:(NSInteger)errorCode
+{
+    NSString *str = nil;
+    switch (errorCode) {
+        case -1001:
+            str = @"请求超时";
+            break;
+        case -1003:
+        case -1004:
+            str = @"服务器错误";
+            break;
+        case -1005:
+            str = @"网络中断";
+            break;
+        case -1009:
+            str = @"无网络连接";
+            break;
+            
+        default:
+            str = [NSString stringWithFormat:@"%@", @"(_errorCode)"];
+            break;
+    }
+    
+    [XCHudHelper showMessage:str];
+    
+}
+
+#pragma mark - color
+- (UIColor*)colorWithHex:(NSInteger)hexValue alpha:(CGFloat)alphaValue
+{
+    return [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16))/255.0
+                           green:((float)((hexValue & 0xFF00) >> 8))/255.0
+                            blue:((float)(hexValue & 0xFF))/255.0
+                           alpha:alphaValue];
+}
+
+- (void)dealloc
+{
+    [self releasePlayer];
+}
+
+
+#pragma mark - image addtion
+- (UIImage *)imageNamed:(NSString *)imageName {
+    
+    NSString *path = [[NSBundle mainBundle] pathForResource:@"TBPlayer" ofType:@"bundle"];
+
+     NSString *imagePath=  [path stringByAppendingPathComponent:@"images"];
+    return [UIImage imageWithContentsOfFile:[imagePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png", imageName]]];
+    
+}
+
+@end

+ 46 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBVideoRequestTask.h

@@ -0,0 +1,46 @@
+//
+//  TBVideoRequestTask.h
+//  avplayerSavebufferData
+//
+//  Created by qianjianeng on 15/9/18.
+//  Copyright (c) 2015年 qianjianeng. All rights reserved.
+//
+//// github地址:https://github.com/suifengqjn/TBPlayer
+
+/// 这个task的功能是从网络请求数据,并把数据保存到本地的一个临时文件,网络请求结束的时候,如果数据完整,则把数据缓存到指定的路径,不完整就删除
+#import <Foundation/Foundation.h>
+#import <AVFoundation/AVFoundation.h>
+
+@class TBVideoRequestTask;
+@protocol TBVideoRequestTaskDelegate <NSObject>
+
+- (void)task:(TBVideoRequestTask *)task didReceiveVideoLength:(NSUInteger)ideoLength mimeType:(NSString *)mimeType;
+- (void)didReceiveVideoDataWithTask:(TBVideoRequestTask *)task;
+- (void)didFinishLoadingWithTask:(TBVideoRequestTask *)task;
+- (void)didFailLoadingWithTask:(TBVideoRequestTask *)task WithError:(NSInteger )errorCode;
+
+@end
+
+@interface TBVideoRequestTask : NSObject
+
+@property (nonatomic, strong, readonly) NSURL                      *url;
+@property (nonatomic, readonly        ) NSUInteger                 offset;
+
+@property (nonatomic, readonly        ) NSUInteger                 videoLength;
+@property (nonatomic, readonly        ) NSUInteger                 downLoadingOffset;
+@property (nonatomic, strong, readonly) NSString                   * mimeType;
+@property (nonatomic, assign)           BOOL                       isFinishLoad;
+
+@property (nonatomic, weak            ) id <TBVideoRequestTaskDelegate> delegate;
+
+
+- (void)setUrl:(NSURL *)url offset:(NSUInteger)offset;
+
+- (void)cancel;
+
+- (void)continueLoading;
+
+- (void)clearData;
+
+
+@end

+ 218 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBVideoRequestTask.m

@@ -0,0 +1,218 @@
+//
+//  TBVideoRequestTask.m
+//  avplayerSavebufferData
+//
+//  Created by qianjianeng on 15/9/18.
+//  Copyright (c) 2015年 qianjianeng. All rights reserved.
+//
+//// github地址:https://github.com/suifengqjn/TBPlayer
+
+#import "TBVideoRequestTask.h"
+
+@interface TBVideoRequestTask () <NSURLConnectionDataDelegate, AVAssetResourceLoaderDelegate>
+
+@property (nonatomic, strong) NSURL           *url;
+@property (nonatomic        ) NSUInteger      offset;
+
+@property (nonatomic        ) NSUInteger      videoLength;
+@property (nonatomic, strong) NSString        *mimeType;
+
+@property (nonatomic, strong) NSURLConnection *connection;
+@property (nonatomic, strong) NSMutableArray  *taskArr;
+
+@property (nonatomic, assign) NSUInteger      downLoadingOffset;
+@property (nonatomic, assign) BOOL            once;
+
+@property (nonatomic, strong) NSFileHandle    *fileHandle;
+@property (nonatomic, strong) NSString        *tempPath;
+
+@end
+
+@implementation TBVideoRequestTask
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _taskArr = [NSMutableArray array];
+        NSString *document = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
+        _tempPath =  [document stringByAppendingPathComponent:@"temp.mp4"];
+        if ([[NSFileManager defaultManager] fileExistsAtPath:_tempPath]) {
+            [[NSFileManager defaultManager] removeItemAtPath:_tempPath error:nil];
+            [[NSFileManager defaultManager] createFileAtPath:_tempPath contents:nil attributes:nil];
+            
+        } else {
+            [[NSFileManager defaultManager] createFileAtPath:_tempPath contents:nil attributes:nil];
+        }
+        
+    }
+    return self;
+}
+
+- (void)setUrl:(NSURL *)url offset:(NSUInteger)offset
+{
+    _url = url;
+    _offset = offset;
+    
+    //如果建立第二次请求,先移除原来文件,再创建新的
+    if (self.taskArr.count >= 1) {
+        [[NSFileManager defaultManager] removeItemAtPath:_tempPath error:nil];
+        [[NSFileManager defaultManager] createFileAtPath:_tempPath contents:nil attributes:nil];
+    }
+    
+    _downLoadingOffset = 0;
+    
+    NSURLComponents *actualURLComponents = [[NSURLComponents alloc] initWithURL:url resolvingAgainstBaseURL:NO];
+    actualURLComponents.scheme = @"http";
+    
+    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[actualURLComponents URL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:20.0];
+    
+    if (offset > 0 && self.videoLength > 0) {
+        [request addValue:[NSString stringWithFormat:@"bytes=%ld-%ld",(unsigned long)offset, (unsigned long)self.videoLength - 1] forHTTPHeaderField:@"Range"];
+    }
+
+    [self.connection cancel];
+    self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
+    [self.connection setDelegateQueue:[NSOperationQueue mainQueue]];
+    [self.connection start];
+       
+}
+
+
+
+- (void)cancel
+{
+    [self.connection cancel];
+    
+}
+
+
+#pragma mark -  NSURLConnection Delegate Methods
+
+
+- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
+{
+    _isFinishLoad = NO;
+    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
+
+    NSDictionary *dic = (NSDictionary *)[httpResponse allHeaderFields] ;
+    
+    NSString *content = [dic valueForKey:@"Content-Range"];
+    NSArray *array = [content componentsSeparatedByString:@"/"];
+    NSString *length = array.lastObject;
+    
+    NSUInteger videoLength;
+    
+    if ([length integerValue] == 0) {
+        videoLength = (NSUInteger)httpResponse.expectedContentLength;
+    } else {
+        videoLength = [length integerValue];
+    }
+    
+    self.videoLength = videoLength;
+    self.mimeType = @"video/mp4";
+    
+
+    if ([self.delegate respondsToSelector:@selector(task:didReceiveVideoLength:mimeType:)]) {
+        [self.delegate task:self didReceiveVideoLength:self.videoLength mimeType:self.mimeType];
+    }
+    
+    [self.taskArr addObject:connection];
+    
+    
+    self.fileHandle = [NSFileHandle fileHandleForWritingAtPath:_tempPath];
+    
+   
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
+{
+    
+    [self.fileHandle seekToEndOfFile];
+    
+    [self.fileHandle writeData:data];
+
+    _downLoadingOffset += data.length;
+    
+    
+    if ([self.delegate respondsToSelector:@selector(didReceiveVideoDataWithTask:)]) {
+        [self.delegate didReceiveVideoDataWithTask:self];
+    }
+    
+    
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+    
+    
+    if (self.taskArr.count < 2) {
+        _isFinishLoad = YES;
+        
+        //这里自己写需要保存数据的路径
+        NSString *document = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
+        NSString *movePath =  [document stringByAppendingPathComponent:@"保存数据.mp4"];
+
+        BOOL isSuccess = [[NSFileManager defaultManager] copyItemAtPath:_tempPath toPath:movePath error:nil];
+        if (isSuccess) {
+            NSLog(@"rename success");
+        }else{
+            NSLog(@"rename fail");
+        }
+        NSLog(@"----%@", movePath);
+    }
+    
+    if ([self.delegate respondsToSelector:@selector(didFinishLoadingWithTask:)]) {
+        [self.delegate didFinishLoadingWithTask:self];
+    }
+    
+}
+
+//网络中断:-1005
+//无网络连接:-1009
+//请求超时:-1001
+//服务器内部错误:-1004
+//找不到服务器:-1003
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+    if (error.code == -1001 && !_once) {      //网络超时,重连一次
+        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+            [self continueLoading];
+        });
+    }
+    if ([self.delegate respondsToSelector:@selector(didFailLoadingWithTask:WithError:)]) {
+        [self.delegate didFailLoadingWithTask:self WithError:error.code];
+    }
+    if (error.code == -1009) {
+        NSLog(@"无网络连接");
+    }
+}
+
+
+- (void)continueLoading
+{
+    _once = YES;
+    NSURLComponents *actualURLComponents = [[NSURLComponents alloc] initWithURL:_url resolvingAgainstBaseURL:NO];
+    actualURLComponents.scheme = @"http";
+    
+    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[actualURLComponents URL] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:20.0];
+    
+    [request addValue:[NSString stringWithFormat:@"bytes=%ld-%ld",(unsigned long)_downLoadingOffset, (unsigned long)self.videoLength - 1] forHTTPHeaderField:@"Range"];
+    
+    
+    [self.connection cancel];
+     self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
+    [self.connection setDelegateQueue:[NSOperationQueue mainQueue]];
+    [self.connection start];
+}
+
+- (void)clearData
+{
+    [self.connection cancel];
+    //移除文件
+    [[NSFileManager defaultManager] removeItemAtPath:_tempPath error:nil];
+    
+    
+    
+}
+@end

+ 30 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBloaderURLConnection.h

@@ -0,0 +1,30 @@
+//
+//  TBloaderURLConnection.h
+//  avplayerSavebufferData
+//
+//  Created by qianjianeng on 15/9/15.
+//  Copyright (c) 2015年 qianjianeng. All rights reserved.
+//
+//// github地址:https://github.com/suifengqjn/TBPlayer
+
+/// 这个connenction的功能是把task缓存到本地的临时数据根据播放器需要的 offset和length去取数据并返回给播放器
+/// 如果视频文件比较小,就没有必要存到本地,直接用一个变量存储即可
+#import <Foundation/Foundation.h>
+#import <AVFoundation/AVFoundation.h>
+
+@class TBVideoRequestTask;
+
+@protocol TBloaderURLConnectionDelegate <NSObject>
+
+- (void)didFinishLoadingWithTask:(TBVideoRequestTask *)task;   
+- (void)didFailLoadingWithTask:(TBVideoRequestTask *)task WithError:(NSInteger )errorCode;
+
+@end
+
+@interface TBloaderURLConnection : NSURLConnection <AVAssetResourceLoaderDelegate>
+
+@property (nonatomic, strong) TBVideoRequestTask *task;
+@property (nonatomic, weak  ) id<TBloaderURLConnectionDelegate> delegate;
+- (NSURL *)getSchemeVideoURL:(NSURL *)url;
+
+@end

+ 191 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/TBloaderURLConnection.m

@@ -0,0 +1,191 @@
+//
+//  TBloaderURLConnection.m
+//  avplayerSavebufferData
+//
+//  Created by qianjianeng on 15/9/15.
+//  Copyright (c) 2015年 qianjianeng. All rights reserved.
+//
+//// github地址:https://github.com/suifengqjn/TBPlayer
+
+#import "TBloaderURLConnection.h"
+#import <Foundation/Foundation.h>
+#import <MobileCoreServices/MobileCoreServices.h>
+#import "TBVideoRequestTask.h"
+
+@interface TBloaderURLConnection ()<TBVideoRequestTaskDelegate>
+
+@property (nonatomic, strong) NSMutableArray *pendingRequests;
+@property (nonatomic, copy  ) NSString       *videoPath;
+
+@end
+
+@implementation TBloaderURLConnection
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        _pendingRequests = [NSMutableArray array];
+        NSString *document = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
+        _videoPath = [document stringByAppendingPathComponent:@"temp.mp4"];
+    }
+    return self;
+}
+
+- (void)fillInContentInformation:(AVAssetResourceLoadingContentInformationRequest *)contentInformationRequest
+{
+    NSString *mimeType = self.task.mimeType;
+    CFStringRef contentType = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, (__bridge CFStringRef)(mimeType), NULL);
+    contentInformationRequest.byteRangeAccessSupported = YES;
+    contentInformationRequest.contentType = CFBridgingRelease(contentType);
+    contentInformationRequest.contentLength = self.task.videoLength;
+}
+
+#pragma mark - AVURLAsset resource loader methods
+
+- (void)processPendingRequests
+{
+    NSMutableArray *requestsCompleted = [NSMutableArray array];  //请求完成的数组
+    //每次下载一块数据都是一次请求,把这些请求放到数组,遍历数组
+    for (AVAssetResourceLoadingRequest *loadingRequest in self.pendingRequests)
+    {
+        [self fillInContentInformation:loadingRequest.contentInformationRequest]; //对每次请求加上长度,文件类型等信息
+        
+        BOOL didRespondCompletely = [self respondWithDataForRequest:loadingRequest.dataRequest]; //判断此次请求的数据是否处理完全
+        
+        if (didRespondCompletely) {
+
+            [requestsCompleted addObject:loadingRequest];  //如果完整,把此次请求放进 请求完成的数组
+            [loadingRequest finishLoading];
+            
+        }
+    }
+
+    [self.pendingRequests removeObjectsInArray:requestsCompleted];   //在所有请求的数组中移除已经完成的
+    
+}
+
+
+- (BOOL)respondWithDataForRequest:(AVAssetResourceLoadingDataRequest *)dataRequest
+{
+    long long startOffset = dataRequest.requestedOffset;
+
+    if (dataRequest.currentOffset != 0) {
+        startOffset = dataRequest.currentOffset;
+    }
+    
+    if ((self.task.offset +self.task.downLoadingOffset) < startOffset)
+    {
+        //NSLog(@"NO DATA FOR REQUEST");
+        return NO;
+    }
+    
+    if (startOffset < self.task.offset) {
+        return NO;
+    }
+    
+    NSData *filedata = [NSData dataWithContentsOfURL:[NSURL fileURLWithPath:_videoPath] options:NSDataReadingMappedIfSafe error:nil];
+    
+    // This is the total data we have from startOffset to whatever has been downloaded so far
+    NSUInteger unreadBytes = self.task.downLoadingOffset - ((NSInteger)startOffset - self.task.offset);
+    
+    // Respond with whatever is available if we can't satisfy the request fully yet
+    NSUInteger numberOfBytesToRespondWith = MIN((NSUInteger)dataRequest.requestedLength, unreadBytes);
+    
+    
+    [dataRequest respondWithData:[filedata subdataWithRange:NSMakeRange((NSUInteger)startOffset- self.task.offset, (NSUInteger)numberOfBytesToRespondWith)]];
+    
+    
+    
+    long long endOffset = startOffset + dataRequest.requestedLength;
+    BOOL didRespondFully = (self.task.offset + self.task.downLoadingOffset) >= endOffset;
+
+    return didRespondFully;
+  
+    
+}
+
+
+/**
+ *  必须返回Yes,如果返回NO,则resourceLoader将会加载出现故障的数据
+ *  这里会出现很多个loadingRequest请求, 需要为每一次请求作出处理
+ *  @param resourceLoader 资源管理器
+ *  @param loadingRequest 每一小块数据的请求
+ *
+ */
+- (BOOL)resourceLoader:(AVAssetResourceLoader *)resourceLoader shouldWaitForLoadingOfRequestedResource:(AVAssetResourceLoadingRequest *)loadingRequest
+{
+    [self.pendingRequests addObject:loadingRequest];
+    [self dealWithLoadingRequest:loadingRequest];
+    NSLog(@"----%@", loadingRequest);
+    return YES;
+}
+
+
+- (void)dealWithLoadingRequest:(AVAssetResourceLoadingRequest *)loadingRequest
+{
+    NSURL *interceptedURL = [loadingRequest.request URL];
+    NSRange range = NSMakeRange((NSUInteger)loadingRequest.dataRequest.currentOffset, NSUIntegerMax);
+    
+    if (self.task.downLoadingOffset > 0) {
+        [self processPendingRequests];
+    }
+    
+    if (!self.task) {
+        self.task = [[TBVideoRequestTask alloc] init];
+        self.task.delegate = self;
+        [self.task setUrl:interceptedURL offset:0];
+    } else {
+        // 如果新的rang的起始位置比当前缓存的位置还大300k,则重新按照range请求数据
+        if (self.task.offset + self.task.downLoadingOffset + 1024 * 300 < range.location ||
+            // 如果往回拖也重新请求
+            range.location < self.task.offset) {
+            [self.task setUrl:interceptedURL offset:range.location];
+        }
+    }
+    
+    
+}
+
+
+- (void)resourceLoader:(AVAssetResourceLoader *)resourceLoader didCancelLoadingRequest:(AVAssetResourceLoadingRequest *)loadingRequest
+{
+    [self.pendingRequests removeObject:loadingRequest];
+    
+}
+
+- (NSURL *)getSchemeVideoURL:(NSURL *)url
+{
+    NSURLComponents *components = [[NSURLComponents alloc] initWithURL:url resolvingAgainstBaseURL:NO];
+    components.scheme = @"streaming";
+    return [components URL];
+}
+
+#pragma mark - TBVideoRequestTaskDelegate
+
+- (void)task:(TBVideoRequestTask *)task didReceiveVideoLength:(NSUInteger)ideoLength mimeType:(NSString *)mimeType
+{
+   
+}
+
+- (void)didReceiveVideoDataWithTask:(TBVideoRequestTask *)task
+{
+    [self processPendingRequests];
+    
+}
+
+- (void)didFinishLoadingWithTask:(TBVideoRequestTask *)task
+{
+    if ([self.delegate respondsToSelector:@selector(didFinishLoadingWithTask:)]) {
+        [self.delegate didFinishLoadingWithTask:task];
+    }
+}
+
+- (void)didFailLoadingWithTask:(TBVideoRequestTask *)task WithError:(NSInteger)errorCode
+{
+    if ([self.delegate respondsToSelector:@selector(didFailLoadingWithTask:WithError:)]) {
+        [self.delegate didFailLoadingWithTask:task WithError:errorCode];
+    }
+    
+}
+@end

+ 435 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/MBProgressHUD.h

@@ -0,0 +1,435 @@
+//
+//  MBProgressHUD.h
+//  Version 1.0.0
+//  Created by Matej Bukovinski on 2.4.09.
+//
+
+// This code is distributed under the terms and conditions of the MIT license. 
+
+// Copyright © 2009-2016 Matej Bukovinski
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+#import <CoreGraphics/CoreGraphics.h>
+
+@class MBBackgroundView;
+@protocol MBProgressHUDDelegate;
+
+
+extern CGFloat const MBProgressMaxOffset;
+
+typedef NS_ENUM(NSInteger, MBProgressHUDMode) {
+    /// UIActivityIndicatorView.
+    MBProgressHUDModeIndeterminate,
+    /// A round, pie-chart like, progress view.
+    MBProgressHUDModeDeterminate,
+    /// Horizontal progress bar.
+    MBProgressHUDModeDeterminateHorizontalBar,
+    /// Ring-shaped progress view.
+    MBProgressHUDModeAnnularDeterminate,
+    /// Shows a custom view.
+    MBProgressHUDModeCustomView,
+    /// Shows only labels.
+    MBProgressHUDModeText
+};
+
+typedef NS_ENUM(NSInteger, MBProgressHUDAnimation) {
+    /// Opacity animation
+    MBProgressHUDAnimationFade,
+    /// Opacity + scale animation (zoom in when appearing zoom out when disappearing)
+    MBProgressHUDAnimationZoom,
+    /// Opacity + scale animation (zoom out style)
+    MBProgressHUDAnimationZoomOut,
+    /// Opacity + scale animation (zoom in style)
+    MBProgressHUDAnimationZoomIn
+};
+
+typedef NS_ENUM(NSInteger, MBProgressHUDBackgroundStyle) {
+    /// Solid color background
+    MBProgressHUDBackgroundStyleSolidColor,
+    /// UIVisualEffectView or UIToolbar.layer background view
+    MBProgressHUDBackgroundStyleBlur
+};
+
+typedef void (^MBProgressHUDCompletionBlock)();
+
+
+NS_ASSUME_NONNULL_BEGIN
+
+
+/** 
+ * Displays a simple HUD window containing a progress indicator and two optional labels for short messages.
+ *
+ * This is a simple drop-in class for displaying a progress HUD view similar to Apple's private UIProgressHUD class.
+ * The MBProgressHUD window spans over the entire space given to it by the initWithFrame: constructor and catches all
+ * user input on this region, thereby preventing the user operations on components below the view.
+ *
+ * @note To still allow touches to pass through the HUD, you can set hud.userInteractionEnabled = NO.
+ * @attention MBProgressHUD is a UI class and should therefore only be accessed on the main thread.
+ */
+@interface MBProgressHUD : UIView
+
+/**
+ * Creates a new HUD, adds it to provided view and shows it. The counterpart to this method is hideHUDForView:animated:.
+ *
+ * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden.
+ *
+ * @param view The view that the HUD will be added to
+ * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use
+ * animations while appearing.
+ * @return A reference to the created HUD.
+ *
+ * @see hideHUDForView:animated:
+ * @see animationType
+ */
++ (instancetype)showHUDAddedTo:(UIView *)view animated:(BOOL)animated;
+
+/// @name Showing and hiding
+
+/**
+ * Finds the top-most HUD subview and hides it. The counterpart to this method is showHUDAddedTo:animated:.
+ *
+ * @note This method sets removeFromSuperViewOnHide. The HUD will automatically be removed from the view hierarchy when hidden.
+ *
+ * @param view The view that is going to be searched for a HUD subview.
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ * @return YES if a HUD was found and removed, NO otherwise.
+ *
+ * @see showHUDAddedTo:animated:
+ * @see animationType
+ */
++ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated;
+
+/**
+ * Finds the top-most HUD subview and returns it. 
+ *
+ * @param view The view that is going to be searched.
+ * @return A reference to the last HUD subview discovered.
+ */
++ (nullable MBProgressHUD *)HUDForView:(UIView *)view;
+
+/**
+ * A convenience constructor that initializes the HUD with the view's bounds. Calls the designated constructor with
+ * view.bounds as the parameter.
+ *
+ * @param view The view instance that will provide the bounds for the HUD. Should be the same instance as
+ * the HUD's superview (i.e., the view that the HUD will be added to).
+ */
+- (instancetype)initWithView:(UIView *)view;
+
+/** 
+ * Displays the HUD. 
+ *
+ * @note You need to make sure that the main thread completes its run loop soon after this method call so that
+ * the user interface can be updated. Call this method when your task is already set up to be executed in a new thread
+ * (e.g., when using something like NSOperation or making an asynchronous call like NSURLRequest).
+ *
+ * @param animated If set to YES the HUD will appear using the current animationType. If set to NO the HUD will not use
+ * animations while appearing.
+ *
+ * @see animationType
+ */
+- (void)showAnimated:(BOOL)animated;
+
+/** 
+ * Hides the HUD. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
+ * hide the HUD when your task completes.
+ *
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ *
+ * @see animationType
+ */
+- (void)hideAnimated:(BOOL)animated;
+
+/** 
+ * Hides the HUD after a delay. This still calls the hudWasHidden: delegate. This is the counterpart of the show: method. Use it to
+ * hide the HUD when your task completes.
+ *
+ * @param animated If set to YES the HUD will disappear using the current animationType. If set to NO the HUD will not use
+ * animations while disappearing.
+ * @param delay Delay in seconds until the HUD is hidden.
+ *
+ * @see animationType
+ */
+- (void)hideAnimated:(BOOL)animated afterDelay:(NSTimeInterval)delay;
+
+/**
+ * The HUD delegate object. Receives HUD state notifications.
+ */
+@property (weak, nonatomic) id<MBProgressHUDDelegate> delegate;
+
+/**
+ * Called after the HUD is hiden.
+ */
+@property (copy, nullable) MBProgressHUDCompletionBlock completionBlock;
+
+/*
+ * Grace period is the time (in seconds) that the invoked method may be run without
+ * showing the HUD. If the task finishes before the grace time runs out, the HUD will
+ * not be shown at all.
+ * This may be used to prevent HUD display for very short tasks.
+ * Defaults to 0 (no grace time).
+ */
+@property (assign, nonatomic) NSTimeInterval graceTime;
+
+/**
+ * The minimum time (in seconds) that the HUD is shown.
+ * This avoids the problem of the HUD being shown and than instantly hidden.
+ * Defaults to 0 (no minimum show time).
+ */
+@property (assign, nonatomic) NSTimeInterval minShowTime;
+
+/**
+ * Removes the HUD from its parent view when hidden.
+ * Defaults to NO.
+ */
+@property (assign, nonatomic) BOOL removeFromSuperViewOnHide;
+
+/// @name Appearance
+
+/** 
+ * MBProgressHUD operation mode. The default is MBProgressHUDModeIndeterminate.
+ */
+@property (assign, nonatomic) MBProgressHUDMode mode;
+
+/**
+ * A color that gets forwarded to all labels and supported indicators. Also sets the tintColor
+ * for custom views on iOS 7+. Set to nil to manage color individually.
+ * Defaults to semi-translucent black on iOS 7 and later and white on earlier iOS versions.
+ */
+@property (strong, nonatomic, nullable) UIColor *contentColor UI_APPEARANCE_SELECTOR;
+
+/**
+ * The animation type that should be used when the HUD is shown and hidden.
+ */
+@property (assign, nonatomic) MBProgressHUDAnimation animationType UI_APPEARANCE_SELECTOR;
+
+/**
+ * The bezel offset relative to the center of the view. You can use MBProgressMaxOffset
+ * and -MBProgressMaxOffset to move the HUD all the way to the screen edge in each direction.
+ * E.g., CGPointMake(0.f, MBProgressMaxOffset) would position the HUD centered on the bottom edge.
+ */
+@property (assign, nonatomic) CGPoint offset UI_APPEARANCE_SELECTOR;
+
+/**
+ * The amount of space between the HUD edge and the HUD elements (labels, indicators or custom views).
+ * This also represents the minimum bezel distance to the edge of the HUD view.
+ * Defaults to 20.f
+ */
+@property (assign, nonatomic) CGFloat margin UI_APPEARANCE_SELECTOR;
+
+/**
+ * The minimum size of the HUD bezel. Defaults to CGSizeZero (no minimum size).
+ */
+@property (assign, nonatomic) CGSize minSize UI_APPEARANCE_SELECTOR;
+
+/**
+ * Force the HUD dimensions to be equal if possible.
+ */
+@property (assign, nonatomic, getter = isSquare) BOOL square UI_APPEARANCE_SELECTOR;
+
+/**
+ * When enabled, the bezel center gets slightly affected by the device accelerometer data.
+ * Has no effect on iOS < 7.0. Defaults to YES.
+ */
+@property (assign, nonatomic, getter=areDefaultMotionEffectsEnabled) BOOL defaultMotionEffectsEnabled UI_APPEARANCE_SELECTOR;
+
+/// @name Progress
+
+/**
+ * The progress of the progress indicator, from 0.0 to 1.0. Defaults to 0.0.
+ */
+@property (assign, nonatomic) float progress;
+
+/// @name ProgressObject
+
+/**
+ * The NSProgress object feeding the progress information to the progress indicator.
+ */
+@property (strong, nonatomic, nullable) NSProgress *progressObject;
+
+/// @name Views
+
+/**
+ * The view containing the labels and indicator (or customView).
+ */
+@property (strong, nonatomic, readonly) MBBackgroundView *bezelView;
+
+/**
+ * View covering the entire HUD area, placed behind bezelView.
+ */
+@property (strong, nonatomic, readonly) MBBackgroundView *backgroundView;
+
+/**
+ * The UIView (e.g., a UIImageView) to be shown when the HUD is in MBProgressHUDModeCustomView.
+ * The view should implement intrinsicContentSize for proper sizing. For best results use approximately 37 by 37 pixels.
+ */
+@property (strong, nonatomic, nullable) UIView *customView;
+
+/**
+ * A label that holds an optional short message to be displayed below the activity indicator. The HUD is automatically resized to fit
+ * the entire text.
+ */
+@property (strong, nonatomic, readonly) UILabel *label;
+
+/**
+ * A label that holds an optional details message displayed below the labelText message. The details text can span multiple lines.
+ */
+@property (strong, nonatomic, readonly) UILabel *detailsLabel;
+
+/**
+ * A button that is placed below the labels. Visible only if a target / action is added. 
+ */
+@property (strong, nonatomic, readonly) UIButton *button;
+
+@end
+
+
+@protocol MBProgressHUDDelegate <NSObject>
+
+@optional
+
+/** 
+ * Called after the HUD was fully hidden from the screen. 
+ */
+- (void)hudWasHidden:(MBProgressHUD *)hud;
+
+@end
+
+
+/**
+ * A progress view for showing definite progress by filling up a circle (pie chart).
+ */
+@interface MBRoundProgressView : UIView 
+
+/**
+ * Progress (0.0 to 1.0)
+ */
+@property (nonatomic, assign) float progress;
+
+/**
+ * Indicator progress color.
+ * Defaults to white [UIColor whiteColor].
+ */
+@property (nonatomic, strong) UIColor *progressTintColor;
+
+/**
+ * Indicator background (non-progress) color. 
+ * Only applicable on iOS versions older than iOS 7.
+ * Defaults to translucent white (alpha 0.1).
+ */
+@property (nonatomic, strong) UIColor *backgroundTintColor;
+
+/*
+ * Display mode - NO = round or YES = annular. Defaults to round.
+ */
+@property (nonatomic, assign, getter = isAnnular) BOOL annular;
+
+@end
+
+
+/**
+ * A flat bar progress view. 
+ */
+@interface MBBarProgressView : UIView
+
+/**
+ * Progress (0.0 to 1.0)
+ */
+@property (nonatomic, assign) float progress;
+
+/**
+ * Bar border line color.
+ * Defaults to white [UIColor whiteColor].
+ */
+@property (nonatomic, strong) UIColor *lineColor;
+
+/**
+ * Bar background color.
+ * Defaults to clear [UIColor clearColor];
+ */
+@property (nonatomic, strong) UIColor *progressRemainingColor;
+
+/**
+ * Bar progress color.
+ * Defaults to white [UIColor whiteColor].
+ */
+@property (nonatomic, strong) UIColor *progressColor;
+
+@end
+
+
+@interface MBBackgroundView : UIView
+
+/**
+ * The background style. 
+ * Defaults to MBProgressHUDBackgroundStyleBlur on iOS 7 or later and MBProgressHUDBackgroundStyleSolidColor otherwise.
+ * @note Due to iOS 7 not supporting UIVisualEffectView, the blur effect differs slightly between iOS 7 and later versions.
+ */
+@property (nonatomic) MBProgressHUDBackgroundStyle style;
+
+/**
+ * The background color or the blur tint color.
+ * @note Due to iOS 7 not supporting UIVisualEffectView, the blur effect differs slightly between iOS 7 and later versions.
+ */
+@property (nonatomic, strong) UIColor *color;
+
+@end
+
+@interface MBProgressHUD (Deprecated)
+
++ (NSArray *)allHUDsForView:(UIView *)view __attribute__((deprecated("Store references when using more than one HUD per view.")));
++ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated __attribute__((deprecated("Store references when using more than one HUD per view.")));
+
+- (id)initWithWindow:(UIWindow *)window __attribute__((deprecated("Use initWithView: instead.")));
+
+- (void)show:(BOOL)animated __attribute__((deprecated("Use showAnimated: instead.")));
+- (void)hide:(BOOL)animated __attribute__((deprecated("Use hideAnimated: instead.")));
+- (void)hide:(BOOL)animated afterDelay:(NSTimeInterval)delay __attribute__((deprecated("Use hideAnimated:afterDelay: instead.")));
+
+- (void)showWhileExecuting:(SEL)method onTarget:(id)target withObject:(id)object animated:(BOOL)animated __attribute__((deprecated("Use GCD directly.")));
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block __attribute__((deprecated("Use GCD directly.")));
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block completionBlock:(nullable MBProgressHUDCompletionBlock)completion __attribute__((deprecated("Use GCD directly.")));
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue __attribute__((deprecated("Use GCD directly.")));
+- (void)showAnimated:(BOOL)animated whileExecutingBlock:(dispatch_block_t)block onQueue:(dispatch_queue_t)queue
+     completionBlock:(nullable MBProgressHUDCompletionBlock)completion __attribute__((deprecated("Use GCD directly.")));
+@property (assign) BOOL taskInProgress __attribute__((deprecated("No longer needed.")));
+
+@property (nonatomic, copy) NSString *labelText __attribute__((deprecated("Use label.text instead.")));
+@property (nonatomic, strong) UIFont *labelFont __attribute__((deprecated("Use label.font instead.")));
+@property (nonatomic, strong) UIColor *labelColor __attribute__((deprecated("Use label.textColor instead.")));
+@property (nonatomic, copy) NSString *detailsLabelText __attribute__((deprecated("Use detailsLabel.text instead.")));
+@property (nonatomic, strong) UIFont *detailsLabelFont __attribute__((deprecated("Use detailsLabel.font instead.")));
+@property (nonatomic, strong) UIColor *detailsLabelColor __attribute__((deprecated("Use detailsLabel.textColor instead.")));
+@property (assign, nonatomic) CGFloat opacity __attribute__((deprecated("Customize bezelView properties instead.")));
+@property (strong, nonatomic) UIColor *color __attribute__((deprecated("Customize the bezelView color instead.")));
+@property (assign, nonatomic) CGFloat xOffset __attribute__((deprecated("Set offset.x instead.")));
+@property (assign, nonatomic) CGFloat yOffset __attribute__((deprecated("Set offset.y instead.")));
+@property (assign, nonatomic) CGFloat cornerRadius __attribute__((deprecated("Set bezelView.layer.cornerRadius instead.")));
+@property (assign, nonatomic) BOOL dimBackground __attribute__((deprecated("Customize HUD background properties instead.")));
+@property (strong, nonatomic) UIColor *activityIndicatorColor __attribute__((deprecated("Use UIAppearance to customize UIActivityIndicatorView. E.g.: [UIActivityIndicatorView appearanceWhenContainedIn:[MBProgressHUD class], nil].color = [UIColor redColor];")));
+@property (atomic, assign, readonly) CGSize size __attribute__((deprecated("Get the bezelView.frame.size instead.")));
+
+@end
+
+NS_ASSUME_NONNULL_END

File diff suppressed because it is too large
+ 1484 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/MBProgressHUD.m


+ 60 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/XCHudHelper.h

@@ -0,0 +1,60 @@
+//
+//  XCHudHelper.h
+//
+//  Created by TopDev on 10/23/14.
+//  Copyright (c) 2014 TopDev. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#import "MBProgressHUD.h"
+
+@interface XCHudHelper : NSObject
+
+@property(nonatomic, strong) MBProgressHUD *hud;
+
+// 单例
++ (XCHudHelper *)sharedInstance;
+
+// 在window上显示菊花转hud
+- (void)showHudAcitivityOnWindow;
+
+// 在window上显示hud
+// 参数:
+// caption:标题
+// bActive:是否显示转圈动画
+// time:自动消失时间,如果为0,则不自动消失
+
+- (void)showHudOnWindow:(NSString *)caption
+                  image:(UIImage *)image
+              acitivity:(BOOL)bAcitve
+           autoHideTime:(NSTimeInterval)time;
+
+// 在当前的view上显示hud
+// 参数:
+// view:要添加hud的view
+// caption:标题
+// image:图片
+// bActive:是否显示转圈动画
+// time:自动消失时间,如果为0,则不自动消失
+- (void)showHudOnView:(UIView *)view
+              caption:(NSString *)caption
+                image:(UIImage *)image
+            acitivity:(BOOL)bAcitve
+         autoHideTime:(NSTimeInterval)time;
+
+- (void)setCaption:(NSString *)caption;
+
+// 隐藏hud
+- (void)hideHud;
+
+- (void)hideHudAfter:(NSTimeInterval)time;
+
+
+//成功,失败,普通信息
++ (void)showSuccess:(NSString *)success;
++ (void)showError:(NSString *)error;
++ (void)showMessage:(NSString *)message;
++ (void)hideHUD;
+
+@end

+ 159 - 0
创维盒子/双子星云手机/Vendor/TBPlayer/XCToast/XCHudHelper.m

@@ -0,0 +1,159 @@
+//
+//  XFHudHelper.m
+//
+//  Created by TopDev on 10/23/14.
+//  Copyright (c) 2014 TopDev. All rights reserved.
+//
+
+#import "XCHudHelper.h"
+
+@implementation XCHudHelper
+
++ (XCHudHelper *)sharedInstance {
+    static XCHudHelper *_instance = nil;
+    
+    @synchronized (self) {
+        if (_instance == nil) {
+            _instance = [[self alloc] init];
+        }
+    }
+    
+    return _instance;
+}
+
+- (void)showHudAcitivityOnWindow
+{
+    [self showHudOnWindow:nil image:nil acitivity:YES autoHideTime:0];
+}
+
+- (void)showHudOnWindow:(NSString *)caption
+                  image:(UIImage *)image
+              acitivity:(BOOL)active
+           autoHideTime:(NSTimeInterval)time1 {
+    
+    if (_hud) {
+        [_hud hideAnimated:NO];
+    }
+    
+    
+    self.hud = [[MBProgressHUD alloc] initWithView:[[UIApplication sharedApplication] delegate].window];
+    [[[UIApplication sharedApplication] delegate].window addSubview:self.hud];
+    self.hud.label.text = caption;
+    self.hud.customView = [[UIImageView alloc] initWithImage:image];
+    self.hud.customView.bounds = CGRectMake(0, 0, 100, 100);
+    self.hud.mode = image ? MBProgressHUDModeCustomView : MBProgressHUDModeIndeterminate;
+    self.hud.animationType = MBProgressHUDAnimationFade;
+    self.hud.removeFromSuperViewOnHide = YES;
+    [self.hud showAnimated:YES];
+    if (time1 > 0) {
+        [self.hud hideAnimated:YES afterDelay:time1];
+    }
+}
+
+- (void)showHudOnView:(UIView *)view
+              caption:(NSString *)caption
+                image:(UIImage *)image
+            acitivity:(BOOL)active
+         autoHideTime:(NSTimeInterval)time1 {
+    
+    if (_hud) {
+        [_hud hideAnimated:NO];
+    }
+    
+    self.hud = [[MBProgressHUD alloc] initWithView:view];
+    [view addSubview:self.hud];
+    self.hud.label.text = caption;
+    self.hud.customView = [[UIImageView alloc] initWithImage:image];
+    self.hud.customView.bounds = CGRectMake(0, 0, 100, 100);
+    self.hud.mode = image ? MBProgressHUDModeCustomView : MBProgressHUDModeIndeterminate;
+    self.hud.animationType = MBProgressHUDAnimationFade;
+    [self.hud showAnimated:YES];
+    if (time1 > 0) {
+        [self.hud hideAnimated:YES afterDelay:time1];
+    }
+}
+
+- (void)setCaption:(NSString *)caption {
+    self.hud.label.text = caption;
+}
+
+
+- (void)hideHud {
+    if (_hud) {
+        [_hud hideAnimated:YES];
+    }
+}
+
+- (void)hideHudAfter:(NSTimeInterval)time1 {
+    if (_hud) {
+        [_hud hideAnimated:YES afterDelay:time1];
+    }
+}
+
+
++ (void)showSuccess:(NSString *)success
+{
+    [self showSuccess:success toView:nil];
+}
+
++ (void)showError:(NSString *)error
+{
+    [self showError:error toView:nil];
+}
+
+
+
++ (void)showError:(NSString *)error toView:(UIView *)view{
+    [self show:error icon:@"error.png" view:view];
+}
+
++ (void)showSuccess:(NSString *)success toView:(UIView *)view
+{
+    [self show:success icon:@"success.png" view:view];
+}
+
+#pragma mark 显示信息
++ (void)show:(NSString *)text icon:(NSString *)icon view:(UIView *)view
+{
+    if (view == nil) view = [[UIApplication sharedApplication].windows lastObject];
+    // 快速显示一个提示信息
+    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
+    hud.label.text = text;
+    // 设置图片
+    hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"MBProgressHUD.bundle/%@", icon]]];
+    // 再设置模式
+    hud.mode = MBProgressHUDModeCustomView;
+    
+    // 隐藏时候从父控件中移除
+    hud.removeFromSuperViewOnHide = YES;
+    
+    // 1.0秒之后再消失
+    [hud hideAnimated:YES afterDelay:1.0];
+}
+
+
++ (void)showMessage:(NSString *)message
+{
+    [self show:message icon:@"" view:nil];
+}
+
++ (void)showMessage:(NSString *)message toView:(UIView *)view {
+    if (view == nil) view = [[UIApplication sharedApplication].windows lastObject];
+    // 快速显示一个提示信息
+    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
+    hud.label.text = message;
+    // 隐藏时候从父控件中移除
+    hud.removeFromSuperViewOnHide = YES;
+    // YES代表需要蒙版效果
+    //hud.dimBackground = YES;
+    // 100秒之后再消失
+    [hud hideAnimated:YES afterDelay:100.0];
+}
+
+
++ (void)hideHUD
+{
+    UIView *view = [[UIApplication sharedApplication].windows lastObject];
+    [MBProgressHUD hideHUDForView:view animated:YES];
+}
+@end