plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[video_player_tizen] "Invalid State" PlatformException when playing "some" live streams

Open T-h-e-Wizard opened this issue 1 year ago • 6 comments

I was able to play the sample mp4 file w/o any problems in the player, but when I changed the URL to a "live stream" one (with .ts extension), I got the following call stack in my debug log:

[E] [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(player_set_play_position failed, Invalid state, null, null)
#0      TizenVideoPlayerApi.seekTo (package:video_player_tizen/src/messages.g.dart:459:7)
<asynchronous suspension>
#1      VideoPlayerController.seekTo (package:video_player/video_player.dart:564:5)
<asynchronous suspension>
#2      VideoPlayerController.play (package:video_player/video_player.dart:458:7)
<asynchronous suspension>

This is what the VideoPlayerValue looks like for the stream, before, and after initialization:

[I] flutter: initState: VideoPlayerValue(duration: 0:00:00.000000, size: Size(0.0, 0.0), position: 0:00:00.000000, caption: Caption(number: 0, start: 0:00:00.000000, end: 0:00:00.000000, text: ), captionOffset: 0:00:00.000000, buffered: [], isInitialized: false, isPlaying: false, isLooping: false, isBuffering: false, volume: 1.0, playbackSpeed: 1.0, errorDescription: null)
[I] flutter: wrapperListener
[I] flutter: contollerListener: VideoPlayerValue(duration: 0:00:00.000000, size: Size(1280.0, 720.0), position: 0:00:00.000000, caption: Caption(number: 0, start: 0:00:00.000000, end: 0:00:00.000000, text: ), captionOffset: 0:00:00.000000, buffered: [], isInitialized: true, isPlaying: false, isLooping: false, isBuffering: false, volume: 1.0, playbackSpeed: 1.0, errorDescription: null)

Checking the call stack, it seems like, when duration is set as zero for the media metadata, flutter video_player ends up calling seekTo(Duration.zero); and this later causes an Invalid State problem(??) on Tizen player side. Can you please confirm? Are live streams not supported in this player? Would you suggest videohole, or avplay alternatives? Thanks!

T-h-e-Wizard avatar Sep 04 '24 14:09 T-h-e-Wizard