react-native-firework-sdk 1.5.4-beta.2 → 1.5.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
8975239F2817DEF80070EBB6 /* LiveStreamModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897523852817DEF80070EBB6 /* LiveStreamModule.swift */; };
|
|
41
41
|
897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 897523862817DEF80070EBB6 /* LiveStreamModule.m */; };
|
|
42
42
|
8977F48528C99340008CC888 /* UINavigationController+FWSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 8977F48428C99340008CC888 /* UINavigationController+FWSwizzle.m */; };
|
|
43
|
+
899703B5296D89B600571B4F /* FWNavigatorUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 899703B4296D89B600571B4F /* FWNavigatorUtils.swift */; };
|
|
44
|
+
899703B8296D9C5C00571B4F /* AVPlayer+FWSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = 899703B7296D9C5C00571B4F /* AVPlayer+FWSwizzle.m */; };
|
|
43
45
|
89DF27DD28A53A77003F3CCB /* StoryBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89DF27DA28A53A77003F3CCB /* StoryBlock.swift */; };
|
|
44
46
|
89DF27DE28A53A77003F3CCB /* StoryBlockManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89DF27DB28A53A77003F3CCB /* StoryBlockManager.swift */; };
|
|
45
47
|
89DF27DF28A53A77003F3CCB /* StoryBlockManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89DF27DC28A53A77003F3CCB /* StoryBlockManager.m */; };
|
|
@@ -96,6 +98,9 @@
|
|
|
96
98
|
897523862817DEF80070EBB6 /* LiveStreamModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LiveStreamModule.m; sourceTree = "<group>"; };
|
|
97
99
|
8977F48328C99340008CC888 /* UINavigationController+FWSwizzle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UINavigationController+FWSwizzle.h"; sourceTree = "<group>"; };
|
|
98
100
|
8977F48428C99340008CC888 /* UINavigationController+FWSwizzle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UINavigationController+FWSwizzle.m"; sourceTree = "<group>"; };
|
|
101
|
+
899703B4296D89B600571B4F /* FWNavigatorUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FWNavigatorUtils.swift; sourceTree = "<group>"; };
|
|
102
|
+
899703B6296D9C5C00571B4F /* AVPlayer+FWSwizzle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AVPlayer+FWSwizzle.h"; sourceTree = "<group>"; };
|
|
103
|
+
899703B7296D9C5C00571B4F /* AVPlayer+FWSwizzle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AVPlayer+FWSwizzle.m"; sourceTree = "<group>"; };
|
|
99
104
|
89DF27DA28A53A77003F3CCB /* StoryBlock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryBlock.swift; sourceTree = "<group>"; };
|
|
100
105
|
89DF27DB28A53A77003F3CCB /* StoryBlockManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoryBlockManager.swift; sourceTree = "<group>"; };
|
|
101
106
|
89DF27DC28A53A77003F3CCB /* StoryBlockManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoryBlockManager.m; sourceTree = "<group>"; };
|
|
@@ -159,6 +164,9 @@
|
|
|
159
164
|
897523682817DEF80070EBB6 /* UIView+ParentViewController.swift */,
|
|
160
165
|
8977F48328C99340008CC888 /* UINavigationController+FWSwizzle.h */,
|
|
161
166
|
8977F48428C99340008CC888 /* UINavigationController+FWSwizzle.m */,
|
|
167
|
+
899703B4296D89B600571B4F /* FWNavigatorUtils.swift */,
|
|
168
|
+
899703B6296D9C5C00571B4F /* AVPlayer+FWSwizzle.h */,
|
|
169
|
+
899703B7296D9C5C00571B4F /* AVPlayer+FWSwizzle.m */,
|
|
162
170
|
);
|
|
163
171
|
path = Utils;
|
|
164
172
|
sourceTree = "<group>";
|
|
@@ -307,9 +315,11 @@
|
|
|
307
315
|
files = (
|
|
308
316
|
8975238A2817DEF80070EBB6 /* UIView+ParentViewController.swift in Sources */,
|
|
309
317
|
8977F48528C99340008CC888 /* UINavigationController+FWSwizzle.m in Sources */,
|
|
318
|
+
899703B8296D9C5C00571B4F /* AVPlayer+FWSwizzle.m in Sources */,
|
|
310
319
|
8975239B2817DEF80070EBB6 /* FireworkSDKModule.swift in Sources */,
|
|
311
320
|
897523952817DEF80070EBB6 /* ShoppingModule.m in Sources */,
|
|
312
321
|
89335CA628E29D3A00B84BC7 /* TrackPurchaseParameters.swift in Sources */,
|
|
322
|
+
899703B5296D89B600571B4F /* FWNavigatorUtils.swift in Sources */,
|
|
313
323
|
897523A02817DEF80070EBB6 /* LiveStreamModule.m in Sources */,
|
|
314
324
|
8975238E2817DEF80070EBB6 /* FireworkSDK+Json.swift in Sources */,
|
|
315
325
|
89DF27E128A53A89003F3CCB /* RCTConvert+StoryBlock.swift in Sources */,
|
|
@@ -125,11 +125,13 @@ class FWNavigatorModule: RCTEventEmitter, FWNavigator {
|
|
|
125
125
|
let presentingVC = presentedVC.presentingViewController,
|
|
126
126
|
presentingVC.presentingViewController == RCTKeyWindow()?.rootViewController {
|
|
127
127
|
NotificationCenter.default.post(name: gOnVideoTemporarilyReleasePipController, object: nil)
|
|
128
|
+
FWNavigatorUtils.shared.shouldDisablePlay = true
|
|
128
129
|
presentedVC.dismiss(animated: false) {
|
|
129
130
|
DispatchQueue.main.async {
|
|
130
131
|
presentingVC.dismiss(animated: true) {
|
|
131
132
|
NotificationCenter.default.post(name: gOnVideoRestorePipController, object: nil)
|
|
132
133
|
resolver(true)
|
|
134
|
+
FWNavigatorUtils.shared.shouldDisablePlay = false
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AVPlayer+FWSwizzle.h
|
|
3
|
+
// FireworkSdk
|
|
4
|
+
//
|
|
5
|
+
// Created by linjie jiang on 2023/1/10.
|
|
6
|
+
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
#import <AVFoundation/AVFoundation.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface AVPlayer (FWSwizzle)
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AVPlayer+FWSwizzle.m
|
|
3
|
+
// FireworkSdk
|
|
4
|
+
//
|
|
5
|
+
// Created by linjie jiang on 2023/1/10.
|
|
6
|
+
// Copyright © 2023 Facebook. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "AVPlayer+FWSwizzle.h"
|
|
10
|
+
#import <objc/runtime.h>
|
|
11
|
+
#import <React/RCTConvert.h>
|
|
12
|
+
#import "react_native_firework_sdk-Swift.h"
|
|
13
|
+
|
|
14
|
+
@implementation AVPlayer (FWSwizzle)
|
|
15
|
+
|
|
16
|
+
+ (void)load {
|
|
17
|
+
static dispatch_once_t once_token;
|
|
18
|
+
dispatch_once(&once_token, ^{
|
|
19
|
+
[self swizzleSelector:@selector(play) targetSelector:@selector(_fw_play)];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
+ (void)swizzleSelector:(SEL)sourceSelector
|
|
24
|
+
targetSelector:(SEL)targetSelector {
|
|
25
|
+
Class class = [self class];
|
|
26
|
+
Method sourceMethod =
|
|
27
|
+
class_getInstanceMethod(class, sourceSelector);
|
|
28
|
+
Method targetMethod =
|
|
29
|
+
class_getInstanceMethod(class, targetSelector);
|
|
30
|
+
BOOL isMethodExists =
|
|
31
|
+
!class_addMethod(class, sourceSelector,
|
|
32
|
+
method_getImplementation(targetMethod),
|
|
33
|
+
method_getTypeEncoding(targetMethod));
|
|
34
|
+
if (isMethodExists) {
|
|
35
|
+
method_exchangeImplementations(sourceMethod, targetMethod);
|
|
36
|
+
} else {
|
|
37
|
+
class_replaceMethod(class, targetSelector,
|
|
38
|
+
method_getImplementation(sourceMethod),
|
|
39
|
+
method_getTypeEncoding(sourceMethod));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
- (void)_fw_play {
|
|
44
|
+
if (FWNavigatorUtils.shared.shouldDisablePlay) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[self _fw_play];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FWNavigatorUtils.swift
|
|
3
|
+
// FireworkSdk
|
|
4
|
+
//
|
|
5
|
+
// Created by linjie jiang on 2023/1/10.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import UIKit
|
|
9
|
+
import FireworkVideo
|
|
10
|
+
|
|
11
|
+
@objc(FWNavigatorUtils)
|
|
12
|
+
public class FWNavigatorUtils: NSObject {
|
|
13
|
+
@objc public static let shared = FWNavigatorUtils()
|
|
14
|
+
|
|
15
|
+
@objc public var shouldDisablePlay = false
|
|
16
|
+
|
|
17
|
+
private override init() {}
|
|
18
|
+
|
|
19
|
+
public override func copy() -> Any {
|
|
20
|
+
return self
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public override func mutableCopy() -> Any {
|
|
24
|
+
return self
|
|
25
|
+
}
|
|
26
|
+
}
|