Skip to content

Commit

Permalink
Added error handling (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
alr2413 authored Aug 6, 2020
1 parent abea8fa commit 1cf6ab9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.0.6
* Updates MobileVLC to allow for handling of vlc error.
credits to Alireza Setayesh (https://github.com/alr2413)

## 3.0.5
* Updates MobileVLC to allow for changing of volume. Example Updated Also.
credits to Mitch Ross (https://github.com/mitchross)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,9 @@ public void onEvent(MediaPlayer.Event event) {

case MediaPlayer.Event.EncounteredError:
System.err.println("(flutter_vlc_plugin) A VLC error occurred.");
eventSink.error("error", "A VLC error occurred.", null);
break;

case MediaPlayer.Event.Paused:
case MediaPlayer.Event.Stopped:
eventObject.put("name", "buffering");
Expand Down
5 changes: 4 additions & 1 deletion lib/flutter_vlc_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';

enum PlayingState { STOPPED, BUFFERING, PLAYING }
enum PlayingState { STOPPED, BUFFERING, PLAYING, ERROR }
enum HwAcc { AUTO, DISABLED, DECODING, FULL }

int getHwAcc({@required HwAcc hwAcc}) {
Expand Down Expand Up @@ -309,6 +309,9 @@ class VlcPlayerController {
_fireEventHandlers();
break;
}
}).onError((e){
_playingState = PlayingState.ERROR;
_fireEventHandlers();
});

_initialized = true;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_vlc_player
description: A VLC-powered alternative to Flutter's video_player. Supports multiple players on one screen.
version: 3.0.5
version: 3.0.6
homepage: https://github.com/solid-software/flutter_vlc_player

environment:
Expand Down

0 comments on commit 1cf6ab9

Please sign in to comment.