Skip to content

Commit 0be9161

Browse files
committed
add eyeOriginPoint and fix bug
1 parent 6bccb94 commit 0be9161

File tree

8 files changed

+26
-1
lines changed

8 files changed

+26
-1
lines changed

VideoPlsInterfaceControllerSDK/VideoPlsInterfaceControllerSDK/VideoPlsInterfaceControllerSDK/VPIServiceConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
1818
@property (nonatomic, assign) VPIVideoAdTimeType duration;
1919

2020
@property (nonatomic, assign) VPIVideoModeType videoModeType;
21+
@property (nonatomic, assign) CGPoint eyeOriginPoint;
2122

2223
@end
2324

VideoPlsInterfaceControllerSDK/VideoPlsInterfaceControllerSDK/VideoPlsInterfaceControllerSDK/VPInterfaceController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,7 @@ - (void)startService:(VPIServiceType )type config:(VPIServiceConfig *)config {
10081008
serviceConfig.type = (VPLuaServiceType)config.type;
10091009
serviceConfig.duration = (VPIVideoAdTimeType)config.duration;
10101010
serviceConfig.videoModeType = (VPLuaVideoModeType)config.videoModeType;
1011+
serviceConfig.eyeOriginPoint = config.eyeOriginPoint;
10111012

10121013
self.serviceManager.osView = self.osView;
10131014
self.serviceManager.desktopView = self.desktopView;

VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VPLua/Applets/Landscape/VPAppletLandscapeContainer.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ - (void)requestApplet {
121121
}
122122

123123
weakSelf.applet = luaObject;
124-
[weakSelf.rootData setValue:[luaObject.miniAppInfo dictionaryValue] forKey:@"miniAppInfo"];
124+
if (weakSelf.rootData != nil && [weakSelf.rootData isKindOfClass:[NSMutableDictionary class]]) {
125+
[weakSelf.rootData setValue:[luaObject.miniAppInfo dictionaryValue] forKey:@"miniAppInfo"];
126+
}
125127
[weakSelf loadContainView];
126128
});
127129
}];

VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VPLua/Manager/VPLuaLoader.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ - (void)checkAndDownloadFilesListWithAppInfo:(VPMiniAppInfo *)appInfo complete:(
9393
if (appInfo && appInfo.appletID) {
9494
[self checkAndDownloadFilesList:appInfo.luaList resumePath:[VPUPPathUtil subPathOfLuaOSPath:appInfo.appletID] complete:complete];
9595
}
96+
else {
97+
NSError *error = [NSError errorWithDomain:VPLuaErrorDomain code:-3000 userInfo:@{NSLocalizedDescriptionKey:[NSString stringWithFormat:@"init data error"]}];
98+
[self callbackComplete:complete withError:error];
99+
}
96100
}
97101

98102
- (void)checkAndDownloadFilesList:(NSArray *)filesList complete:(VPLuaLoaderCompletionBlock)complete {

VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VPLua/Manager/VPLuaNativeBridge.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ +(int) lvClassDefine:(lua_State *)L globalName:(NSString*) globalName{
312312
{"currentVideoTime", currentVideoTime},
313313
{"videoDuration", videoDuration},
314314
{"commonTrack", commonTrack},
315+
{"screenScale", screenScale},
315316
// {"appletSize", getAppletSize},
316317
{NULL, NULL}
317318
};
@@ -1408,6 +1409,11 @@ static int px2Dpi(lua_State *L) {
14081409
return 0;
14091410
}
14101411

1412+
static int screenScale(lua_State *L) {
1413+
lua_pushnumber(L, [UIScreen mainScreen].scale);
1414+
return 1;
1415+
}
1416+
14111417
static int preloadImage(lua_State *L) {
14121418
if (lua_gettop(L) >= 2) {
14131419
if( lua_type(L, 2) == LUA_TTABLE ) {

VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VPLua/Manager/VPLuaService.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef void(^VPLuaServiceCompletionBlock)(NSError *error);
3131
@property (nonatomic, assign) VPLuaServiceType type;
3232
@property (nonatomic, assign) NSInteger duration;
3333
@property (nonatomic, assign) VPLuaVideoModeType videoModeType;
34+
@property (nonatomic, assign) CGPoint eyeOriginPoint;
3435

3536
@end
3637

@@ -40,6 +41,7 @@ typedef void(^VPLuaServiceCompletionBlock)(NSError *error);
4041
@property (nonatomic, copy) NSString *videoId;
4142
@property (nonatomic, assign) VPLuaServiceType type;
4243
@property (nonatomic, assign) VPLuaVideoModeType videoModeType;
44+
@property (nonatomic, assign) CGPoint eyeOriginPoint;
4345

4446
- (instancetype)initWithConfig:(VPLuaServiceConfig *)config;
4547

VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VPLua/Manager/VPLuaService.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ - (instancetype)initWithConfig:(VPLuaServiceConfig *)config {
2020
_videoId = config.identifier;
2121
_type = config.type;
2222
_videoModeType = config.videoModeType;
23+
_eyeOriginPoint = config.eyeOriginPoint;
2324
}
2425
return self;
2526
}

VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VideoPlsLuaViewManagerSDK/VPLua/Manager/VPLuaServiceVideoMode.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,14 @@ - (void)runLuaWithData:(NSMutableDictionary *)data {
300300
data = [NSMutableDictionary dictionary];
301301
}
302302
[data setObject:[self.configData objectForKey:@"desktopMiniAppInfo"] forKey:@"miniAppInfo"];
303+
if (self.config.eyeOriginPoint.x > 0 || self.config.eyeOriginPoint.y > 0) {
304+
[data setValue:@(self.config.eyeOriginPoint.x) forKey:@"eyeOriginPointX"];
305+
[data setValue:@(self.config.eyeOriginPoint.y) forKey:@"eyeOriginPointY"];
306+
}
307+
if (self.configData) {
308+
[data setValue:self.configData forKey:@"labelConfData"];
309+
}
310+
303311
NSURL *desktopUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@://desktopLuaView?template=%@&id=%@&miniAppId=%@",
304312
VPUPRoutesSDKLuaView,
305313
[[dict objectForKey:@"desktopMiniAppInfo"] objectForKey:@"template"],

0 commit comments

Comments
 (0)