Skip to content

Commit

Permalink
I split 2 license key for 2 platforms for easy management
Browse files Browse the repository at this point in the history
iosLicenseKey and androidLicenseKey
  • Loading branch information
VNAPNIC committed Mar 16, 2020
1 parent 4d9ee39 commit ce2be35
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,15 @@ Ensure the following permission is present in your Android Manifest file, locate

```dart
WOWZCameraView(
apiLicenseKey: (defaultTargetPlatform == TargetPlatform.android)
? "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx"
: "GOSK-xxxx-xxxx-xxxx-xxxx-xxxx",
controller: controller,
hostAddress: "xxx.xxx.xxx.xxx",
portNumber: 1935,
applicationName: "xxxxxx",
streamName: "xxxxx",
username: "xxxx",
password: "xxxx",
scaleMode: ScaleMode.FILL_VIEW,
statusCallback: (status) {
print(
"status: ${status.mState} | ${status.isStarting()} | ${status.isReady()}");
},
broadcastStatusCallback: (broadcastStatus) {
print(
"status: ${broadcastStatus.state.toString()} | ${broadcastStatus.message}");
},
androidLicenseKey: "GOSK-9C47-010C-2895-D225-9FEF",
iosLicenseKey: "GOSK-9C47-010C-A9B9-EB78-3FBD",
controller: controller,
statusCallback: (status) {
print("status: ${status.mState} | ${status.isStarting()} | ${status.isReady()}");
},
broadcastStatusCallback: (broadcastStatus) {
print("status: ${broadcastStatus.state.toString()} | ${broadcastStatus.message}");
},
)
```

Expand All @@ -79,6 +69,19 @@ Control live streams
WOWZCameraController controller = WOWZCameraController();
```

configuration wowza

```dart
controller.setWOWZConfig(
hostAddress: "xxx.xxx.xxx.xxx",
portNumber: 1935,
applicationName: "xxxxxx",
streamName: "xxxxx",
username: "xxxx",
password: "xxxx",
scaleMode: ScaleMode.FILL_VIEW
);
```

## Functionality supported

Expand Down
6 changes: 2 additions & 4 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ class _MyAppState extends State<MyApp> {
height: 720,
width: 1280,
child: WOWZCameraView(
apiLicenseKey:
(defaultTargetPlatform == TargetPlatform.android)
? "GOSK-9C47-010C-2895-D225-9FEF"
: "GOSK-9C47-010C-A9B9-EB78-3FBD",
androidLicenseKey: "GOSK-9C47-010C-2895-D225-9FEF",
iosLicenseKey: "GOSK-9C47-010C-A9B9-EB78-3FBD",
controller: controller,
statusCallback: (status) {
print(
Expand Down
12 changes: 9 additions & 3 deletions lib/gocoder/src/wowz_camera_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ abstract class OnWOWZBroadcastStatusCallback {
class WOWZCameraView extends StatefulWidget {
WOWZCameraView(
{@required this.controller,
@required this.apiLicenseKey,
@required this.androidLicenseKey,
@required this.iosLicenseKey,
this.statusCallback,
this.broadcastStatusCallback});

Expand All @@ -75,7 +76,8 @@ class WOWZCameraView extends StatefulWidget {
final WOWZStatusCallback statusCallback;
final WOWZBroadcastStatusCallback broadcastStatusCallback;

final String apiLicenseKey;
final String androidLicenseKey;
final String iosLicenseKey;
}

class _WOWZCameraViewState extends State<WOWZCameraView> {
Expand Down Expand Up @@ -173,7 +175,11 @@ class _WOWZCameraViewState extends State<WOWZCameraView> {
}
});
// license key gocoder sdk
_channel.invokeMethod(_apiLicenseKey, widget.apiLicenseKey);
_channel.invokeMethod(
_apiLicenseKey,
(defaultTargetPlatform == TargetPlatform.android)
? widget.androidLicenseKey
: widget.iosLicenseKey);

if (widget.controller.configIsWaiting) {
widget.controller.resetConfig();
Expand Down

0 comments on commit ce2be35

Please sign in to comment.