-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
packages/hmssdk_flutter/lib/src/enum/hms_recording_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
enum HMSRecordingState { | ||
none, | ||
|
||
starting, | ||
|
||
started, | ||
|
||
paused, | ||
|
||
resumed, | ||
|
||
stopped, | ||
|
||
failed, | ||
} | ||
|
||
extension HMSRecordingStateValues on HMSRecordingState { | ||
static HMSRecordingState getRecordingStateFromName(String name) { | ||
switch (name) { | ||
case 'NONE': | ||
return HMSRecordingState.none; | ||
case 'STARTING': | ||
return HMSRecordingState.starting; | ||
case 'STARTED': | ||
return HMSRecordingState.started; | ||
case 'PAUSED': | ||
return HMSRecordingState.paused; | ||
case 'RESUMED': | ||
return HMSRecordingState.resumed; | ||
case 'STOPPED': | ||
return HMSRecordingState.stopped; | ||
case 'FAILED': | ||
return HMSRecordingState.failed; | ||
default: | ||
return HMSRecordingState.none; | ||
} | ||
} | ||
|
||
static String getNameFromRecordingState(HMSRecordingState state) { | ||
switch (state) { | ||
case HMSRecordingState.none: | ||
return 'NONE'; | ||
|
||
case HMSRecordingState.starting: | ||
return 'STARTING'; | ||
|
||
case HMSRecordingState.started: | ||
return 'STARTED'; | ||
|
||
case HMSRecordingState.paused: | ||
return 'PAUSED'; | ||
|
||
case HMSRecordingState.resumed: | ||
return 'RESUMED'; | ||
|
||
case HMSRecordingState.stopped: | ||
return 'STOPPED'; | ||
|
||
case HMSRecordingState.failed: | ||
return 'FAILED'; | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/hmssdk_flutter/lib/src/enum/hms_streaming_state.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
enum HMSStreamingState { | ||
none, | ||
|
||
starting, | ||
|
||
started, | ||
|
||
stopped, | ||
|
||
failed, | ||
} | ||
|
||
extension HMSStreamingStateValues on HMSStreamingState { | ||
static HMSStreamingState getStreamingStateFromName(String name) { | ||
switch (name) { | ||
case 'NONE': | ||
return HMSStreamingState.none; | ||
case 'STARTING': | ||
return HMSStreamingState.starting; | ||
case 'STARTED': | ||
return HMSStreamingState.started; | ||
case 'STOPPED': | ||
return HMSStreamingState.stopped; | ||
case 'FAILED': | ||
return HMSStreamingState.failed; | ||
default: | ||
return HMSStreamingState.none; | ||
} | ||
} | ||
|
||
static String getNameFromStreamingState(HMSStreamingState state) { | ||
switch (state) { | ||
case HMSStreamingState.none: | ||
return 'NONE'; | ||
|
||
case HMSStreamingState.starting: | ||
return 'STARTING'; | ||
|
||
case HMSStreamingState.started: | ||
return 'STARTED'; | ||
|
||
case HMSStreamingState.stopped: | ||
return 'STOPPED'; | ||
|
||
case HMSStreamingState.failed: | ||
return 'FAILED'; | ||
} | ||
} | ||
} |