Skip to content

Commit cf1c38f

Browse files
committed
change lua files update and lua HttpRequest
1 parent 962ad05 commit cf1c38f

File tree

32 files changed

+1456
-327
lines changed

32 files changed

+1456
-327
lines changed

Example/VPInterfaceControllerDemo.xcodeproj/project.pbxproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
D022A0E520C7EDCD00F46029 /* VPTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = D022A0E420C7EDCD00F46029 /* VPTextField.m */; };
3434
D078CD78214A04BD008946CC /* config.json in Resources */ = {isa = PBXBuildFile; fileRef = D078CD77214A04BD008946CC /* config.json */; };
3535
D078CD7B214A054D008946CC /* VPWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D078CD7A214A054D008946CC /* VPWebViewController.m */; };
36+
D0C76AC52283C93D00C4791F /* VPVideoAppSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = D0C76AC32283C93C00C4791F /* VPVideoAppSettingView.m */; };
3637
D0DA384621A7E2F20014A855 /* VPLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D0DA384521A7E2F20014A855 /* VPLoginViewController.m */; };
3738
/* End PBXBuildFile section */
3839

@@ -81,6 +82,8 @@
8182
D078CD77214A04BD008946CC /* config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = config.json; sourceTree = "<group>"; };
8283
D078CD79214A054D008946CC /* VPWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VPWebViewController.h; sourceTree = "<group>"; };
8384
D078CD7A214A054D008946CC /* VPWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VPWebViewController.m; sourceTree = "<group>"; };
85+
D0C76AC32283C93C00C4791F /* VPVideoAppSettingView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VPVideoAppSettingView.m; sourceTree = "<group>"; };
86+
D0C76AC42283C93C00C4791F /* VPVideoAppSettingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPVideoAppSettingView.h; sourceTree = "<group>"; };
8487
D0DA384421A7E2F20014A855 /* VPLoginViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPLoginViewController.h; sourceTree = "<group>"; };
8588
D0DA384521A7E2F20014A855 /* VPLoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VPLoginViewController.m; sourceTree = "<group>"; };
8689
F5D5F0ACF62048D7E569DF7F /* Pods-VPInterfaceControllerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-VPInterfaceControllerDemo.release.xcconfig"; path = "../Pods/Target Support Files/Pods-VPInterfaceControllerDemo/Pods-VPInterfaceControllerDemo.release.xcconfig"; sourceTree = "<group>"; };
@@ -144,6 +147,8 @@
144147
069D54371F04DC6D001E5324 /* VPInterfaceControllerDemo */ = {
145148
isa = PBXGroup;
146149
children = (
150+
D0C76AC42283C93C00C4791F /* VPVideoAppSettingView.h */,
151+
D0C76AC32283C93C00C4791F /* VPVideoAppSettingView.m */,
147152
D0DA384421A7E2F20014A855 /* VPLoginViewController.h */,
148153
D0DA384521A7E2F20014A855 /* VPLoginViewController.m */,
149154
D078CD76214A04BD008946CC /* Resources */,
@@ -264,6 +269,7 @@
264269
developmentRegion = English;
265270
hasScannedForEncodings = 0;
266271
knownRegions = (
272+
English,
267273
en,
268274
Base,
269275
);
@@ -323,15 +329,11 @@
323329
buildActionMask = 2147483647;
324330
files = (
325331
);
326-
inputFileListPaths = (
327-
);
328332
inputPaths = (
329333
"${PODS_ROOT}/Target Support Files/Pods-VPInterfaceControllerDemo/Pods-VPInterfaceControllerDemo-resources.sh",
330334
"${PODS_ROOT}/../Resources/VideoPlsResources.bundle",
331335
);
332336
name = "[CP] Copy Pods Resources";
333-
outputFileListPaths = (
334-
);
335337
outputPaths = (
336338
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/VideoPlsResources.bundle",
337339
);
@@ -371,6 +373,7 @@
371373
D022A0E020C6932B00F46029 /* VPVideoSettingView.m in Sources */,
372374
0689653C1F15F2BB0054736C /* VPMediaControlView.m in Sources */,
373375
D022A0E520C7EDCD00F46029 /* VPTextField.m in Sources */,
376+
D0C76AC52283C93D00C4791F /* VPVideoAppSettingView.m in Sources */,
374377
D022A0DD20C688C900F46029 /* VPLiveTypeSelectViewController.m in Sources */,
375378
C42CDB951F33289F00DD42D0 /* PrivateConfig.m in Sources */,
376379
069D543A1F04DC6D001E5324 /* main.m in Sources */,

Example/VPInterfaceControllerDemo/AppDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2828
version = [version stringByAppendingString:@"_"];
2929
version = [version stringByAppendingString: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *) kCFBundleVersionKey]];
3030
[MobClick setAppVersion:version];
31-
[VPIConfigSDK setAppKey:@"b3423144-3bd7-4b1c-8771-1ca606b600b4" appSecret:@"40f913f5ecbb4225"];
32-
// [[VPUPDebugSwitch sharedDebugSwitch] switchEnvironment:VPUPDebugStateTest];
31+
[VPIConfigSDK setAppKey:@"921ac192-a38b-4b09-905d-e0c352ec624a" appSecret:@"6cc1f566c36e4165"];
32+
[[VPUPDebugSwitch sharedDebugSwitch] switchEnvironment:VPUPDebugStateTest];
3333
[VPIConfigSDK initSDK];
3434
return YES;
3535
}

Example/VPInterfaceControllerDemo/Resources/adInfo.json

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,151 @@
3030
"needShowOnPortrait": true
3131
}
3232
},
33+
{
34+
"creativeId": 442,
35+
"data": {
36+
"isShowAds": true,
37+
"creativeName": "卡牌2张+有广告&有关闭*道具",
38+
"interactionTypeName": "卡牌",
39+
"creativeIdList": [
40+
1251,
41+
1252,
42+
1253,
43+
1254
44+
],
45+
"interactionTemplateId": 245,
46+
"hotspotArray": [
47+
{
48+
"imageUrl": "http://os-open-static.videojj.com/test/a09b6672-8a30-4f00-b71b-7998f047153d.png",
49+
"title": "香蜜卡牌1"
50+
},
51+
{
52+
"imageUrl": "http://os-open-static.videojj.com/test/a3ceac3f-e303-445f-892a-39c53b0858b8.png",
53+
"title": "香蜜卡牌2"
54+
}
55+
],
56+
"isShowClose": true,
57+
"creativeId": "442",
58+
"infoTrackLink": 1,
59+
"readonly": false,
60+
"success": {
61+
"itemId": "1000",
62+
"title": "恭喜你收集成功啦!〜"
63+
},
64+
"interactionTypeId": "205",
65+
"collect": {
66+
"btnTitle": "领奖去咯",
67+
"imageUrl": "http://os-open-static.videojj.com/test/c079ffee-54ca-4615-8c50-680813d2d9f7.jpeg",
68+
"linkUrl": "",
69+
"linkType": 1,
70+
"content": "收集香密沉沉小锦觅凤凰cp照,解琐神秘奖励〜"
71+
},
72+
"errorSchema": {}
73+
},
74+
"duration": 10000,
75+
"hotspotOrder": 1,
76+
"hotspotTrackLink": [
77+
{
78+
"clickTrackLink": "http://clickc.admaster.com.cn/c/a122445,b3176288,c3925,i0,m101,8a2,8b3,h",
79+
"exposureTrackLink": "http://v.admaster.com.cn/i/a122445,b3176288,c3925,i0,m202,8a2,8b3,h"
80+
},
81+
{
82+
"clickTrackLink": "http://clickc.admaster.com.cn/c/a122445,b3176289,c3925,i0,m101,8a2,8b3,h",
83+
"exposureTrackLink": "http://v.admaster.com.cn/i/a122445,b3176289,c3925,i0,m202,8a2,8b3,h"
84+
}
85+
],
86+
"id": "10e2c51a-cbd3-45c5-9b45-343568971b0f",
87+
"infoTrackLink": [
88+
{
89+
"clickTrackLink": "http://clickc.admaster.com.cn/c/a122445,b3176291,c3925,i0,m101,8a2,8b3,h",
90+
"exposureTrackLink": "http://v.admaster.com.cn/i/a122445,b3176291,c3925,i0,m202,8a2,8b3,h"
91+
}
92+
],
93+
"launchPlanId": 1275,
94+
"sumHotspot": 2,
95+
"template": "os_card_hotspot.lua",
96+
"videoEndTime": 28000,
97+
"videoStartTime": 18000
98+
},
99+
{
100+
"creativeId": 451,
101+
"data": {
102+
"isShowAds": true,
103+
"creativeName": "投票7个+无关闭无规则",
104+
"interactionTypeName": "投票",
105+
"creativeIdList": [
106+
1276,
107+
1277,
108+
1278,
109+
1279,
110+
1280,
111+
1281,
112+
1282,
113+
1283,
114+
1284,
115+
1285
116+
],
117+
"voteTitle": "以下角色你最喜欢谁呢",
118+
"interactionTemplateId": 247,
119+
"voteList": [
120+
{
121+
"imageUrl": "http://os-open-static.videojj.com/test/a27910aa-091d-4248-9d33-d84314bbd41f.jpeg",
122+
"title": "龙龙龙龙龙"
123+
},
124+
{
125+
"imageUrl": "http://os-open-static.videojj.com/test/ed61cdaa-4524-4ace-9469-fd4ddc650658.jpeg",
126+
"title": "凤凤凤凤凤"
127+
},
128+
{
129+
"imageUrl": "http://os-open-static.videojj.com/test/0bde717f-0145-4b62-9742-e14b11ef86a2.jpeg",
130+
"title": "葡萄葡萄呀"
131+
},
132+
{
133+
"imageUrl": "http://os-open-static.videojj.com/test/412fac69-ea26-42da-b335-3b38cdaa9ff6.jpeg",
134+
"title": "第四个选项"
135+
},
136+
{
137+
"imageUrl": "http://os-open-static.videojj.com/test/6c6f2e82-915f-4026-aadc-27116f71f65a.jpeg",
138+
"title": "孔雀孔雀啊"
139+
},
140+
{
141+
"imageUrl": "http://os-open-static.videojj.com/test/bbf3c1e7-121c-4b69-ad20-f9c5b657dc40.jpeg",
142+
"title": "第六个选项"
143+
},
144+
{
145+
"imageUrl": "http://os-open-static.videojj.com/test/f7102734-5680-4ce1-bd49-049e1bda48d8.jpeg",
146+
"title": "第七个选项"
147+
}
148+
],
149+
"isShowClose": false,
150+
"voteImageUrl": "http://os-open-static.videojj.com/test/f2ae0a87-fe88-4e38-9b8f-bf4a90cf9ef0.jpeg",
151+
"infoTrackLink": 1,
152+
"readonly": false,
153+
"imageUrl": "http://os-open-static.videojj.com/test/71ba03e2-95a0-4bac-93d7-8a4d3fabe991.jpeg",
154+
"interactionTypeId": "207",
155+
"errorSchema": {}
156+
},
157+
"duration": 15000,
158+
"hotspotOrder": 0,
159+
"hotspotTrackLink": [
160+
{
161+
"clickTrackLink": "http://clickc.admaster.com.cn/c/a122445,b3176283,c3925,i0,m101,8a2,8b3,h",
162+
"exposureTrackLink": "http://v.admaster.com.cn/i/a122445,b3176283,c3925,i0,m202,8a2,8b3,h"
163+
}
164+
],
165+
"id": "0952a370-372a-4714-b676-ac65a5c2b411",
166+
"infoTrackLink": [
167+
{
168+
"clickTrackLink": "http://clickc.admaster.com.cn/c/a122445,b3176284,c3925,i0,m101,8a2,8b3,h",
169+
"exposureTrackLink": "http://v.admaster.com.cn/i/a122445,b3176284,c3925,i0,m202,8a2,8b3,h"
170+
}
171+
],
172+
"launchPlanId": 1284,
173+
"sumHotspot": 1,
174+
"template": "os_vote_finance_hotspot.lua",
175+
"videoEndTime": 175000,
176+
"videoStartTime": 160000
177+
},
33178
{
34179
"id": "5aa5fa5133edbf375fe43fff",
35180
"videoStartTime": 1000,

Example/VPInterfaceControllerDemo/Resources/config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"room_id": [
2020
"https://static.videojj.com/online/video/Team%20Video%2B%2B_We_Are_Young.mp4",
2121
"http://qa-video.oss-cn-beijing.aliyuncs.com/mp4/victoria90s.mp4",
22+
"http://qa-video.oss-cn-beijing.aliyuncs.com/mp4/mby02.mp4",
23+
"http://qa-video.oss-cn-beijing.aliyuncs.com/mp4/shn48.mp4",
2224
"34",
2325
"2121651",
2426
"2121652",

Example/VPInterfaceControllerDemo/VPLiveTypeSelectViewController.m

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
#import "PrivateConfig.h"
1313
#import "VPSinglePlayerViewController.h"
1414
#import "VPTextField.h"
15+
#import "VPVideoAppSettingView.h"
1516

1617
#import <VideoOS/VideoPlsUtilsPlatformSDK/VideoPlsUtilsPlatformSDK.h>
18+
#import <VideoOS/VideoPlsInterfaceControllerSDK/VPIConfigSDK.h>
1719

1820

1921
@interface VPLiveSettingView : UIView <UIGestureRecognizerDelegate>
@@ -313,6 +315,8 @@ @interface VPLiveTypeSelectViewController ()
313315

314316
@property (nonatomic, weak) UIButton *mallButton;
315317
@property (nonatomic, weak) UIButton *liveButton;
318+
@property (nonatomic, weak) UIButton *appInfoViewButton;
319+
@property (nonatomic, strong) VPVideoAppSettingView *appSettingView;
316320

317321
@end
318322

@@ -378,6 +382,15 @@ - (void)viewDidLoad {
378382
[liveButton addTarget:self action:@selector(liveButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside];
379383
self.liveButton = liveButton;
380384

385+
UIButton *appInfoViewButton = [UIButton buttonWithType:UIButtonTypeCustom];
386+
[appInfoViewButton setImage:whiteImage forState:UIControlStateNormal];
387+
[appInfoViewButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
388+
[appInfoViewButton setTitle:@"APP" forState:UIControlStateNormal];
389+
appInfoViewButton.titleEdgeInsets = UIEdgeInsetsMake(0, -whiteImage.size.width, 0, 0);
390+
[self.view addSubview:appInfoViewButton];
391+
[appInfoViewButton addTarget:self action:@selector(appInfoViewButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside];
392+
self.appInfoViewButton = appInfoViewButton;
393+
381394
[anchorButton mas_makeConstraints:^(MASConstraintMaker *make) {
382395
make.width.mas_equalTo(320);
383396
make.height.mas_equalTo(80);
@@ -410,8 +423,17 @@ - (void)viewDidLoad {
410423
make.centerX.equalTo(setButton.mas_centerX);
411424
make.bottom.equalTo(liveButton.mas_top).with.offset(-10);
412425
}];
426+
427+
[appInfoViewButton mas_makeConstraints:^(MASConstraintMaker *make) {
428+
make.width.mas_equalTo(whiteImage.size.width);
429+
make.height.mas_equalTo(whiteImage.size.height);
430+
make.centerX.equalTo(setButton.mas_centerX);
431+
make.bottom.equalTo(mallButton.mas_top).with.offset(-10);
432+
}];
433+
413434
liveButton.hidden = YES;
414435
mallButton.hidden = YES;
436+
appInfoViewButton.hidden = YES;
415437

416438
[PrivateConfig shareConfig].platformID = @"556c38e7ec69d5bf655a0fb2";
417439
[PrivateConfig shareConfig].identifier = @"40";
@@ -446,10 +468,12 @@ - (IBAction)setButtonDidClicked:(UIButton *)sender {
446468
if (self.mallButton.hidden == YES) {
447469
self.mallButton.hidden = NO;
448470
self.liveButton.hidden = NO;
471+
self.appInfoViewButton.hidden = NO;
449472
}
450473
else {
451474
self.mallButton.hidden = YES;
452475
self.liveButton.hidden = YES;
476+
self.appInfoViewButton.hidden = YES;
453477
}
454478
}
455479

@@ -468,6 +492,36 @@ - (IBAction)liveButtonDidClicked:(UIButton *)sender {
468492
}];
469493
}
470494

495+
- (IBAction)appInfoViewButtonDidClicked:(id)sender {
496+
VPVideoAppSettingView *appSettingView = [[VPVideoAppSettingView alloc] initWithFrame:self.view.bounds data:self.configData];
497+
[self.view addSubview:appSettingView];
498+
[appSettingView mas_makeConstraints:^(MASConstraintMaker *make) {
499+
make.top.equalTo(self.navigationController.navigationBar.mas_bottom);
500+
make.left.equalTo(self.view.mas_left);
501+
make.right.equalTo(self.view.mas_right);
502+
make.bottom.equalTo(self.view.mas_bottom);
503+
}];
504+
[appSettingView.applyButton addTarget:self action:@selector(appSettingViewApplyButtonDidClicked:) forControlEvents:UIControlEventTouchUpInside];
505+
self.appSettingView = appSettingView;
506+
}
507+
508+
- (void)appSettingViewApplyButtonDidClicked:(id)sender {
509+
if (self.appSettingView.appKeyTextField.text.length > 0 && self.appSettingView.appSecretTextField.text.length == 16) {
510+
[PrivateConfig shareConfig].environment = self.appSettingView.environmentControl.selectedSegmentIndex;
511+
[[VPUPDebugSwitch sharedDebugSwitch] switchEnvironment:[PrivateConfig shareConfig].environment];
512+
[VPIConfigSDK setAppKey:self.appSettingView.appKeyTextField.text appSecret:self.appSettingView.appSecretTextField.text];
513+
514+
[self.appSettingView.appKeyTextField resignFirstResponder];
515+
[self.appSettingView.appSecretTextField resignFirstResponder];
516+
[self.appSettingView removeFromSuperview];
517+
self.appSettingView = nil;
518+
}
519+
else {
520+
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"错误" message:@"请输入正确格式的AppKey和AppSecret" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
521+
[alert show];
522+
}
523+
}
524+
471525
/*
472526
#pragma mark - Navigation
473527

Example/VPInterfaceControllerDemo/VPSinglePlayerViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88

99
#import <UIKit/UIKit.h>
10-
#import <VideoPlsInterfaceControllerSDK/VPInterfaceController.h>
10+
#import <VideoOS/VideoPlsInterfaceControllerSDK/VPInterfaceController.h>
1111

1212
@interface VPSinglePlayerViewController : UIViewController
1313

0 commit comments

Comments
 (0)