Commit 97e09d2d authored by 骆林昊's avatar 骆林昊
Browse files

PolyvShortVideoDemo_iOS 版本1.2.0

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'PolyvShortVideoDemo' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for PolyvShortVideoDemo
# 短视频库
pod 'PolyvShortVideoSDK', '~> 1.2.1'
# 上传库依赖库
pod 'AFNetworking', '~> 3.0'
# 公共库
pod 'MBProgressHUD', '~> 1.1.0'
pod 'SDWebImage', '~> 4.0'
pod 'FMDB', '~> 2.5'
pod 'JSONModel'
pod 'LXReorderableCollectionViewFlowLayout'
# 滑动屏幕主页所需库
pod 'Masonry', '~> 1.1'
pod 'ABN_PolyvVodSDK', '~> 2.6.1'
target 'PolyvShortVideoDemoTests' do
inherit! :search_paths
# Pods for testing
end
target 'PolyvShortVideoDemoUITests' do
inherit! :search_paths
# Pods for testing
end
end
This diff is collapsed.
<?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>SchemeUserState</key>
<dict>
<key>PolyvShortVideoDemo.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>21</integer>
</dict>
</dict>
</dict>
</plist>
//
// AppDelegate.h
// PolyvShortVideoDemo
//
// Created by Lincal on 2019/3/13.
// Copyright © 2019 polyv. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
//
// AppDelegate.m
// PolyvShortVideoDemo
//
// Created by Lincal on 2019/3/13.
// Copyright © 2019 polyv. All rights reserved.
//
#import "AppDelegate.h"
#import <PLVVodSDK/PLVVodSDK.h>
#import <PLVShortVideoUploadSDK/PLVShortVideoUploadSDK.h>
#import <PolyvShortVideoSDK/PLVVideoSDKInfo.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// 请联系管理员获取保利威点播账号,以下为Demo演示账号
NSString * vodConfigString = @"tZXXlu6RN9PKbQNo7SfUHGGzt9+lUs2KhoCxh7Uvy7TzCw3VluDwHi1hdin0Ryd3h0T+rkkr8L4kJImiBBSqEha5hOVmlppRqFlt0ZlY3xnUeMHRG/nW4u5n/AFDOvX1jjc3GvcoDfEnGjWIhVHW0g==";
// 点播SDK 账号配置
NSError * vodErr;
PLVVodSettings * vodSettings = [PLVVodSettings settingsWithConfigString:vodConfigString
error:&vodErr];
vodSettings.logLevel = PLVVodLogLevelSilent; // 点播日志打印级别
if (vodErr) { NSLog(@"POLYVTEST - vodSettings %@",vodErr); }
// 短视频上传SDK 账号配置
[PLVUGCBase settingsWithConfigString:vodConfigString
key:@"VXtlHmwfS2oYm0CZ"
iv:@"2u9gDPKdX6GyQJKU"];
// 短视频SDK 打印配置
[PLVVideoSDKInfo setLogLevel:PlvLogError]; // 短视频打印级别
NSLog(@"PolyvShortVideoSDK - version %@",[PLVVideoSDKInfo version]); // 短视频SDK 版本号打印
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "1024iPhoneNotification_20pt@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "1024iPhoneNotification_20pt@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "1024iPhoneSpootlight5_29pt@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "1024iPhoneSpootlight5_29pt@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "1024iPhoneSpootlight7_40pt@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "1024iPhoneSpootlight7_40pt@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "1024iPhoneApp_60pt@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "1024iPhoneApp_60pt@3x.png",
"scale" : "3x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "1024store_1024pt.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina5_5" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="c4G-Gk-Yb9"/>
<viewControllerLayoutGuide type="bottom" id="HZe-k1-Coy"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="99G-Vo-VcX">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="2JP-es-5q4">
<objects>
<navigationController id="99G-Vo-VcX" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="PBx-M6-Ocf">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="J15-vN-NMk" kind="relationship" relationship="rootViewController" id="SFs-s5-Vlc"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="hOc-Ks-LDK" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1609" y="133"/>
</scene>
<!--Home View Controller-->
<scene sceneID="0fe-YT-xT9">
<objects>
<viewController automaticallyAdjustsScrollViewInsets="NO" id="J15-vN-NMk" customClass="PLVHomeViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="kQd-3z-g63"/>
<viewControllerLayoutGuide type="bottom" id="cSZ-NG-scz"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="E2C-va-Nrh">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<navigationItem key="navigationItem" id="SM0-Py-1xB"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="31f-6C-Tmv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-679" y="682"/>
</scene>
</scenes>
</document>
//
// MBProgressHUD+PLVHelper.h
// PolyvShortVideoDemo
//
// Created by Linc on 2018/4/12.
// Copyright © 2018年 Polyv. All rights reserved.
//
#import <MBProgressHUD/MBProgressHUD.h>
NS_ASSUME_NONNULL_BEGIN
@interface MBProgressHUD (PLVHelper)
///**
// 警告图片
//
// @return 警告图片
// */
//+ (UIImage *)warningImage;
//
//
///**
// 成功图片
//
// @return 成功图片
// */
//+ (UIImage *)sucessImage;
/**
展示成功的信息
@param message 要展示的字
@param view 展示view所在的视图
*/
+ (void)showSucessMessage:(NSString *)message inView:(UIView *)view;
/**
展示警告的信息
@param message 展示的文字
@param view 展示view所在的视图
*/
+ (void)showWarningMessage:(NSString *)message inView:(UIView *)view;
/**
展示信息
@param message 信息
@param view 展示view所在的视图
*/
+ (void)showMessage:(NSString *)message inView:(UIView *)view;
/**
一直展示信息
@param message 信息
@param view 展示view所在的视图
*/
+ (MBProgressHUD *)showMessage:(NSString *)message alwaysInView:(UIView *)view;
@end
NS_ASSUME_NONNULL_END
//
// MBProgressHUD+PLVHelper.m
// PolyvShortVideoDemo
//
// Created by Linc on 2018/4/12.
// Copyright © 2018年 Polyv. All rights reserved.
//
#import "MBProgressHUD+PLVHelper.h"
static CGFloat secondPerText = 0.16;
@implementation MBProgressHUD (PLVHelper)
+ (UIImage *)warningImage{
return [UIImage imageNamed:@"plvPromptWarning"];
}
+ (UIImage *)sucessImage{
return [UIImage imageNamed:@"plvPromptSuccess"];
}
+ (void)showMessage:(NSString *)message image:(UIImage *)image inView:(UIView *)view{
MBProgressHUD *hud =[MBProgressHUD showHUDAddedTo:view animated:true];
hud.mode = MBProgressHUDModeCustomView;
hud.customView = [[UIImageView alloc]initWithImage:image];
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.bezelView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];
hud.contentColor = [UIColor whiteColor];
hud.label.numberOfLines = 5;
hud.label.text = message;
[hud hideAnimated:true afterDelay:[MBProgressHUD showTimeWithMessage:message]];
}
+ (CGFloat )showTimeWithMessage:(NSString *)message{
if (message) {
CGFloat time = message.length * secondPerText;
if (time > 5) {
time = 5;
}
return time;
}
return 0;
}
+ (void)showSucessMessage:(NSString *)message inView:(UIView *)view{
[self showMessage:message image:[self sucessImage] inView:view];
}
+ (void)showWarningMessage:(NSString *)message inView:(UIView *)view{
[self showMessage:message image:[self warningImage] inView:view];
}
+ (void)showMessage:(NSString *)message inView:(UIView *)view{
MBProgressHUD *hud =[MBProgressHUD showHUDAddedTo:view animated:true];
hud.mode = MBProgressHUDModeText;
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.bezelView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];
hud.contentColor = [UIColor whiteColor];
hud.label.numberOfLines = 10;
hud.label.text = message;
[hud hideAnimated:true afterDelay:[MBProgressHUD showTimeWithMessage:message]];
}
+ (MBProgressHUD *)showMessage:(NSString *)message alwaysInView:(UIView *)view{
MBProgressHUD *hud =[MBProgressHUD showHUDAddedTo:view animated:true];
hud.mode = MBProgressHUDModeIndeterminate;
hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor;
hud.bezelView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];
hud.contentColor = [UIColor whiteColor];
hud.label.numberOfLines = 10;
hud.label.text = message;
return hud;
}
@end
//
// NSArray+PLVDeepCopy.h
// PolyvShortVideoDemo
//
// Created by Linc on 2018/9/5.
// Copyright © 2018年 Polyv. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSArray (PLVDeepCopy);
-(instancetype)deepCopy;
@end
//
// NSArray+PLVDeepCopy.m
// PolyvShortVideoDemo
//
// Created by Linc on 2018/9/5.
// Copyright © 2018年 Polyv. All rights reserved.
//
#import "NSArray+PLVDeepCopy.h"
@implementation NSArray (PLVDeepCopy)
-(instancetype)deepCopy{
if ([self isKindOfClass:[NSArray class]]) {
NSArray *arr =(NSArray *)[NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:self]];
return arr;
}else{
return self;
}
}
@end
//
// NSData+PLVHelper.h
// PolyvShortVideoDemo
//
// Created by Linc on 2019/1/11.
// Copyright © 2019年 Polyv. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface NSData (PLVHelper)
+ (NSData *)dataWithObject:(id <NSSecureCoding>)object;
+ (nullable id<NSSecureCoding>)customInstanceFromData:(NSData *)data forClassType:(Class)classType;
@end
NS_ASSUME_NONNULL_END
//
// NSData+PLVHelper.m
// PolyvShortVideoDemo
//
// Created by Linc on 2019/1/11.
// Copyright © 2019年 Polyv. All rights reserved.
//
#import "NSData+PLVHelper.h"
@implementation NSData (PLVHelper)
+ (NSData *)dataWithObject:(id<NSSecureCoding>)object{
NSMutableData *data = [[NSMutableData alloc]init];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc]initForWritingWithMutableData:data];
[archiver setRequiresSecureCoding:YES];
[archiver encodeObject:object forKey:NSKeyedArchiveRootObjectKey];
[archiver finishEncoding];
return data;
}
+ (nullable id<NSSecureCoding>)customInstanceFromData:(NSData *)data forClassType:(Class)classType {
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc]initForReadingWithData:data];
[unarchiver setRequiresSecureCoding:YES];
id object = [unarchiver decodeObjectOfClass:[classType class] forKey:NSKeyedArchiveRootObjectKey];