-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[video_player_tizen] "Invalid State" PlatformException when playing "some" live streams #732
Comments
Hi Thank you for your interesting :)
Can you tell me your "live stream" sample URL? Is it a valid URL or is there a network issue accessing the url from your device? Because I tested it using this sample and it works fine. --- a/packages/video_player/example/lib/main.dart
+++ b/packages/video_player/example/lib/main.dart
@@ -219,7 +219,9 @@ class _BumbleBeeRemoteVideoState extends State<_BumbleBeeRemoteVideo> {
void initState() {
super.initState();
_controller = VideoPlayerController.network(
- 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
+ 'https://testfileorg.netwet.net/Sample%20Video/sample_1920x1080.ts',
closedCaptionFile: _loadCaptions(),
videoPlayerOptions: VideoPlayerOptions(mixWithOthers: true),
);
The exception message that occurs when performing a SeekTo on content that is not loaded properly seems to need to be more review.
video_player_tizen is implemented using MediaPlayer API provided by Tizen. videohole and avplay are for DRM streams. If you use DRM Streams, you can use the package with partner-level certificate. |
@JSUYA Thank you very much for your quick, and detailed answer! 🙏 Let me go through your answer paragraph by paragraph, and share my answers/thoughts:
The URL for the live stream I was trying contained credentials that I could not share, that was why I haven't mentioned that in my earlier post. The URL you've shared is also not quite a "live" (continuous) stream (w/o a fixed duration), but a fixed length (~28 seconds) video that the player could retrieve the
The duration for that particular iptv stream was also read as Are there any particular debugging suggestions there? As far as I can see,
The TV is a '24 model Q series one. So it shouldn't be skimping on codec/etc support I'm guessing, but I'll compare the working/non-working live streams in detail to make sure, and increase my own debugging coverage. |
While checking the streaming functionality of video_player, I found that the player is having issues with the duration being set to 0 during the initialization step in this content case. It seems that we need a feature that updates the duration in real time during video streaming. This PR temporarily sets the duration to a non-zero value. So seekTo() operation using progress will not work properly. We will improve this in the future. I hope this helps you.
dlog is not support on TV due to VD's security policy. There is currently no way to check the dlog. |
Thanks again for the quick return (even w/ a code-fix/workaround)! That change indeed meant progress for the particular stream I was working with! The player at least started playing audio of the stream. The video wasn't shown, and the audio unfortunately stopped after 20-30 seconds, but those can probably be narrowed down to the stream codec/etc. What VLC shows for that stream is below [1] btw. It's one unlucky stream I'm afraid - I'll keep on testing w/ a broader list of streams, to see if that's an exception, or a typical stream from this provider. Also, I wanted to let you know that a Duration of 0 probably was not the "only" reason this stream was messing up the player. As I've mentioned earlier, the 2.5.0 player was able to play other test streams (http - https) (from iptv.org repo)(where a non-zero intial size was read) even though the duration was also 0 (my log details below) [2]. As you can see in the logs, there was another exception, ("not implemented" for (Yet another note: With your current workaround, there may be a risk (as I could see from the my logs), that the [1]
[2]
|
Guess what!?!!!... An important part of the problems about my test streams turned out to be due to some inconsistent workspace problem!... When a debug version of the program wasn't running at all on the TV (even though it had very minor/insignificant changes compared to an earlier running version), I tried a After running (I've tried going back to 2.5.0 in this new workspace, and the test streams did NOT work - so |
In VideoPlayer's play(), if position and duration are the same, call seekTo(Duration.zero); (as you mentioned above). So I added a patch to get the duration of live streaming content from TV. (Of course, there are still issues with non-TV profiles.)
I will close this once #742 is merged.
flutter-tizen writes the version of flutter supported by flutter-tizen (and flutter-tizen/embedder) here and syncs the commit when executing the flutter-tizen command.
If you need help, could you please create a new issue with more details? |
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:This is what the VideoPlayerValue looks like for the stream, before, and after initialization:
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 anInvalid 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!The text was updated successfully, but these errors were encountered: