File tree Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -353,22 +353,25 @@ class _PlayerWidgetState extends State<PlayerWidget>
353
353
});
354
354
355
355
_player.stream.error.listen ((error) async {
356
- _errorHandler.handleError (
357
- error,
358
- () async {
359
- if (contentItem.contentType == ContentType .liveStream) {
360
- await _player.open (Media (liveStreamContentItem! .url));
361
- }
362
- },
363
- (errorMessage) {
364
- ScaffoldMessenger .of (context).showSnackBar (
365
- SnackBar (
366
- content: Text (errorMessage),
367
- duration: Duration (seconds: 3 ),
368
- ),
369
- );
370
- },
371
- );
356
+ print ('PLAYER ERROR -> $error ' );
357
+ if (error.contains ('Failed to open' )) {
358
+ _errorHandler.handleError (
359
+ error,
360
+ () async {
361
+ if (contentItem.contentType == ContentType .liveStream) {
362
+ await _player.open (Media (liveStreamContentItem! .url));
363
+ }
364
+ },
365
+ (errorMessage) {
366
+ ScaffoldMessenger .of (context).showSnackBar (
367
+ SnackBar (
368
+ content: Text (errorMessage),
369
+ duration: Duration (seconds: 3 ),
370
+ ),
371
+ );
372
+ },
373
+ );
374
+ }
372
375
});
373
376
374
377
_player.stream.playlist.listen ((playlist) {
You can’t perform that action at this time.
0 commit comments