Skip to content

Commit

Permalink
Updated file path
Browse files Browse the repository at this point in the history
  • Loading branch information
Decoder07 committed Dec 12, 2023
1 parent 9c97262 commit 7e20ca8
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 0 deletions.
63 changes: 63 additions & 0 deletions packages/hmssdk_flutter/lib/src/enum/hms_recording_state.dart
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 packages/hmssdk_flutter/lib/src/enum/hms_streaming_state.dart
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';
}
}
}

0 comments on commit 7e20ca8

Please sign in to comment.