stopPlayingFileToRemote method

  1. @override
Future<int> stopPlayingFileToRemote({
  1. required int sessionId,
})
override

Stops the file playback running on a session.

Invokes the native 'stopPlayingFileToRemote' method via MethodChannel.

Returns 0 on success, -1 or error code on failure.

Implementation

@override
Future<int> stopPlayingFileToRemote({required int sessionId}) async {
  final args = {'sessionId': sessionId};
  _logCall('stopPlayingFileToRemote', args);
  try {
    final result = await methodChannel.invokeMethod<int>(
      'stopPlayingFileToRemote',
      args,
    );
    _logResponse('stopPlayingFileToRemote', result);
    return result ?? -1;
  } on PlatformException catch (e) {
    _logError('stopPlayingFileToRemote', e);
    return -1;
  }
}