Skip to content

Commit ce2be35

Browse files
committed
I split 2 license key for 2 platforms for easy management
iosLicenseKey and androidLicenseKey
1 parent 4d9ee39 commit ce2be35

File tree

3 files changed

+33
-26
lines changed

3 files changed

+33
-26
lines changed

README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,15 @@ Ensure the following permission is present in your Android Manifest file, locate
5151

5252
```dart
5353
WOWZCameraView(
54-
apiLicenseKey: (defaultTargetPlatform == TargetPlatform.android)
55-
? "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx"
56-
: "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx",
57-
controller: controller,
58-
hostAddress: "xxx.xxx.xxx.xxx",
59-
portNumber: 1935,
60-
applicationName: "xxxxxx",
61-
streamName: "xxxxx",
62-
username: "xxxx",
63-
password: "xxxx",
64-
scaleMode: ScaleMode.FILL_VIEW,
65-
statusCallback: (status) {
66-
print(
67-
"status: ${status.mState} | ${status.isStarting()} | ${status.isReady()}");
68-
},
69-
broadcastStatusCallback: (broadcastStatus) {
70-
print(
71-
"status: ${broadcastStatus.state.toString()} | ${broadcastStatus.message}");
72-
},
54+
androidLicenseKey: "GOSK-9C47-010C-2895-D225-9FEF",
55+
iosLicenseKey: "GOSK-9C47-010C-A9B9-EB78-3FBD",
56+
controller: controller,
57+
statusCallback: (status) {
58+
print("status: ${status.mState} | ${status.isStarting()} | ${status.isReady()}");
59+
},
60+
broadcastStatusCallback: (broadcastStatus) {
61+
print("status: ${broadcastStatus.state.toString()} | ${broadcastStatus.message}");
62+
},
7363
)
7464
```
7565

@@ -79,6 +69,19 @@ Control live streams
7969
WOWZCameraController controller = WOWZCameraController();
8070
```
8171

72+
configuration wowza
73+
74+
```dart
75+
controller.setWOWZConfig(
76+
hostAddress: "xxx.xxx.xxx.xxx",
77+
portNumber: 1935,
78+
applicationName: "xxxxxx",
79+
streamName: "xxxxx",
80+
username: "xxxx",
81+
password: "xxxx",
82+
scaleMode: ScaleMode.FILL_VIEW
83+
);
84+
```
8285

8386
## Functionality supported
8487

example/lib/main.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ class _MyAppState extends State<MyApp> {
4545
height: 720,
4646
width: 1280,
4747
child: WOWZCameraView(
48-
apiLicenseKey:
49-
(defaultTargetPlatform == TargetPlatform.android)
50-
? "GOSK-9C47-010C-2895-D225-9FEF"
51-
: "GOSK-9C47-010C-A9B9-EB78-3FBD",
48+
androidLicenseKey: "GOSK-9C47-010C-2895-D225-9FEF",
49+
iosLicenseKey: "GOSK-9C47-010C-A9B9-EB78-3FBD",
5250
controller: controller,
5351
statusCallback: (status) {
5452
print(

lib/gocoder/src/wowz_camera_view.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ abstract class OnWOWZBroadcastStatusCallback {
6363
class WOWZCameraView extends StatefulWidget {
6464
WOWZCameraView(
6565
{@required this.controller,
66-
@required this.apiLicenseKey,
66+
@required this.androidLicenseKey,
67+
@required this.iosLicenseKey,
6768
this.statusCallback,
6869
this.broadcastStatusCallback});
6970

@@ -75,7 +76,8 @@ class WOWZCameraView extends StatefulWidget {
7576
final WOWZStatusCallback statusCallback;
7677
final WOWZBroadcastStatusCallback broadcastStatusCallback;
7778

78-
final String apiLicenseKey;
79+
final String androidLicenseKey;
80+
final String iosLicenseKey;
7981
}
8082

8183
class _WOWZCameraViewState extends State<WOWZCameraView> {
@@ -173,7 +175,11 @@ class _WOWZCameraViewState extends State<WOWZCameraView> {
173175
}
174176
});
175177
// license key gocoder sdk
176-
_channel.invokeMethod(_apiLicenseKey, widget.apiLicenseKey);
178+
_channel.invokeMethod(
179+
_apiLicenseKey,
180+
(defaultTargetPlatform == TargetPlatform.android)
181+
? widget.androidLicenseKey
182+
: widget.iosLicenseKey);
177183

178184
if (widget.controller.configIsWaiting) {
179185
widget.controller.resetConfig();

0 commit comments

Comments
 (0)