Skip to content
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] How to get an Error when the network connection is lost? #549

Open
nassimus26 opened this issue Mar 23, 2023 · 29 comments
Open

Comments

@nassimus26
Copy link

Here's my code :

asTizenController().addListener(() {
          var state = asTizenController().value;
          String error = state.errorDescription??"";
          if (state.isPlaying) {
            _eventStreamController.add(PlayEvent(this, PlayerStatus.PLAYING, null));
          } else if (state.hasError) {
            _errorStreamController.add(PlayError(error, null, this, false));
          }
        });

The problem is that I am not getting any error when I disconnect my Wifi !

I am trying to dig into the Plugin code to understand what's happening, so I have 2 others questions :

1- Is it possible to debug the dart code from the IDE ? if yes how ?
2- In the Tizen plugin code we have:

void VideoPlayer::OnError(int code, void *data) {
  auto *player = reinterpret_cast<VideoPlayer *>(data);
  LOG_DEBUG("[VideoPlayer] error code: %d", code);

  if (player->event_sink_) {
    player->event_sink_->Error("Player error", get_error_message(code));
  }
}

But in the console, I don't see any kind of the player logging message (events or errors), so is it possible to activate and see this C or C# logging message in the dart console ? or how to see them ?

@swift-kim swift-kim changed the title How to get an Error when when the network connection is lost ? [video_player] How to get an Error when when the network connection is lost? Mar 23, 2023
@swift-kim
Copy link
Member

Doesn't disconnecting the device from the network mean that it can't even send error messages to your host? (because it is not connected to anything)

@nassimus26
Copy link
Author

nassimus26 commented Mar 23, 2023

My app has been rejected because when the tester disable the device wifi, my app shows no errors, it's normal because my tests shows that no errors events comes when the wifi is disconnected during the play, actualy I continue to get normal position progress event, but the stream is not playing any more, this is a bug of the player

But immediately when I reconnect the Wifi, strangly I get an Error from the player :

asTizenController().addListener(() {
          var state = asTizenController().value;
          String msg = ">> event isPlaying "+state.isPlaying.toString()+" hasError "+state.hasError.toString()+" error "+error+
              " state.position "+ state.position.toString();
          print(msg);
  });

I got this when I reconnect the WIFI after disconnecting it for 20 seconds.

>> event isPlaying false hasError true error Streaming connection failed state.position 0:00:00.000000

@nassimus26
Copy link
Author

nassimus26 commented Mar 23, 2023

@swift-kim I don't think that disabling the PC wifi stop events, because as I said I continue to get normal positon events after disabling the wifi :

[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:20.972000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:21.453000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:21.953000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.105000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.314000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.523000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.686000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.011000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.150000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.359000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.638000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.916000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:24.056000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:24.404000
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:24.752000

@nassimus26
Copy link
Author

nassimus26 commented Mar 23, 2023

Here's a screen recording, which shows the bug, the player continue to send a progressing position when the Wifi is disabled

https://drive.google.com/file/d/1lo_enTz2aIaUaL4SSBL7QH9UtxK98PPM/view?usp=sharing

@nassimus26 nassimus26 changed the title [video_player] How to get an Error when when the network connection is lost? [video_player] How to get an Error when the network connection is lost? Mar 23, 2023
@nassimus26
Copy link
Author

nassimus26 commented Mar 23, 2023

As a temporary work around, I tried to use an HttpProxy to detect the loose of the connection 👍

But I am getting this permission denied OS Error :

Unhandled Exception: SocketException: Failed to create server socket (OS Error: Permission denied, errno = 13), address = loca
lhost, port = 642
#0      _NativeSocket.bind (dart:io-patch/socket_patch.dart:1008:7)

@nassimus26
Copy link
Author

@swift-kim I am using an emulator, so the events use the local loop I think, that's why I don't need the Wifi to get the events

@swift-kim
Copy link
Member

Okay, I thought you were using a physical TV device. Which emulator device (mobile or wearable?) did you use? Probably you didn't use TV emulator, as it is not supported by the video_player_tizen plugin.

It seems the native VideoPlayer::OnError callback is not properly being called by the platform. This looks like a platform bug. We'll take a look if we can reproduce the issue.

To see the logs printed by LOG_DEBUG, you can simply run

sdb dlog VideoPlayerTizenPlugin

in the host shell if you're using a mobile or wearable emulator. If you're debugging on a physical TV or TV emulator, you'll need to replace dlog_print in the log.h file with something like printf to see the errors since dlog is not supported by TV.

@hyue7
Copy link
Collaborator

hyue7 commented Mar 24, 2023

@nassimus26 Hi~
I use this stream (duration 2 minutes) to test in TV emulator.
After playing 5 seconds, I disconnect wifi,and after several seconds, streaming connection failed.
By the way, I test on a TV device(not emulator ), also connection failed after disconnect wifi.
this are error logs test on emulator:

Snipaste_2023-03-24_17-26-43

But I use a stream which duration only 30 seconds,it isn't stop after disconnection wifi.
Maybe the streaming duration is too short, video has already buffered, so it will not stop after disconnection wifi.

@nassimus26
Copy link
Author

nassimus26 commented Mar 24, 2023

@hyue7 I did my tests with live streams located in this file (the Samsung tester also) (first ones) https://github.com/nassimus26/naviptv/blob/main/demo.m3u

The problem is that the stream play stop on the player (TV or Emulator, inside the emulator the sound is stopped), but I continue to get new positions progress without any error and this for a long time, when I reconnect the Wifi sometimes I recieve an Error sometimes not.

@nassimus26
Copy link
Author

nassimus26 commented Mar 24, 2023

@swift-kim I am using the TV Emulator, I trust the sound, if I hear the sound I know it's playing, I don't need the image because my code is working fine on others platforms (Windows, Android), I am just porting the App to Tizen

I just retest, and I confirm to you that the positions continue to come after the play has stopped.

@nassimus26
Copy link
Author

nassimus26 commented Mar 24, 2023

@swift-kim I tried to apply your suggested changes but I am not good in C#

#define LOG(prio, fmt, arg...)                                         \
  **printf**(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, \
             __LINE__, ##arg)

Gives this error , probably the function signature is different

#define LOG_DEBUG(fmt, args...) LOG(DLOG_DEBUG, fmt, ##args)
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/log.h:16:3: note: expanded from macro 'LOG'
  printf(prio, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, \

@nassimus26
Copy link
Author

Ok, I finally change it to a simple printf(fmt) , it compile, but the command C:\tizen-studio\tools>sdb dlog VideoPlayerTizenPlugin shows nothing

@swift-kim
Copy link
Member

swift-kim commented Mar 24, 2023

If you decide to use printf, it should look like:

#define LOG(prio, fmt, arg...) \
  printf("%s: %s(%d) > " fmt "\n", __MODULE__, __func__, __LINE__, ##arg)

Ok, I finally change it to a simple printf(fmt) , it compile, but the command C:\tizen-studio\tools>sdb dlog VideoPlayerTizenPlugin shows nothing

dlog is not supported on TV. You can see the standard output of the app in the flutter-tizen run console.

@nassimus26
Copy link
Author

nassimus26 commented Mar 24, 2023

I diconnect the Wifi around 6 seconds, the sound stop at 12 seconds , but here the full log (and it has never stopped ):

It continue to send new positions until 23 seconds, then it send the same position 23 seconds indefinitely (the good news is that it stop incrementing the position, but between 12 seconds and 23 seconds, the player is not playing so no way to notify the user quickly)

The tested stream is :

#EXTINF:-1 tvg-id="BumblebeeTVCountryBoyKidsVideo.us" tvg-logo="https://i.imgur.com/p14DjHo.png" group-title="Kids",Bumblebee TV Country Boy Kids Video (720p)
https://stitcheraws.unreel.me/wse-node02.powr.com/live/5bf225aed5eeee0f5a4094bd/playlist.m3u8
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 11537
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:11.537000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 12055
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:12.055000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 12556
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:12.556000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 13059
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:13.059000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 13556
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:13.556000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 14055
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:14.055000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 14560
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:14.560000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 15062
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:15.062000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 15573
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:15.573000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 16068
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:16.068000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 16562
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:16.562000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 17095
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:17.095000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 17641
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:17.641000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 18056
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:18.056000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 18566
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:18.566000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 19059
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:19.059000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 19557
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:19.557000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 20060
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:20.060000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 20564
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:20.564000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 21062
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:21.062000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 21609
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:21.609000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 22057
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.057000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 22558
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.558000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 22821
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:22.821000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23030
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.030000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239
[I] flutter: >> event isPlaying true hasError false error  state.position 0:00:23.239000
[I] video_player_tizen_plugin.cc: Position(223) > [VideoPlayerTizenPlugin] textureId: 12
[I] video_player.cc: GetPosition(249) > [VideoPlayer] position: 23239

@nassimus26
Copy link
Author

nassimus26 commented Mar 24, 2023

Another observation, if I don't disconnect the WIFI, after around 30 seconds of play the Sound is stopped (it's not playing anymore), but the position continue to progress indefinitely also

@nassimus26
Copy link
Author

After resizing a Wearable and testing on it, I think that Emulator is so slow that I am losing the sound after 30 seconds, but it continue to play (sometimes it's black screen but most of time it's blinking between the video and black screen ).

It's impossible to test the player well on any Emulator Wearable or not.

@hyue7
Copy link
Collaborator

hyue7 commented Mar 29, 2023

@nassimus26 I test on TV emulator, it can receive connnection failed error message after video stop playing. The position stopped first and then get the connnection failed message.
the process is:
disconnect network --> play buffer --> buffer end --> throw connnection failed

If you want to immediately stop video, maybe you can use this plugin connectivity_plus to listen network status, and then stop video by app.

@nassimus26
Copy link
Author

Hi @hyue7 did you try with the live stream url which I used ?

@nassimus26
Copy link
Author

nassimus26 commented Mar 29, 2023

@hyue7 No the true problem is not just the network status, most Iptv providers use temporary stream link, so when the link reach the end we need to get the error as quickly as possible to generate a new link

@hyue7
Copy link
Collaborator

hyue7 commented Mar 29, 2023

Hi @hyue7 did you try with the live stream url which I used ?

Yes, I tried this:
https://stitcheraws.unreel.me/wse-node02.powr.com/live/5bf225aed5eeee0f5a4094bd/playlist.m3u8
disconnect network in 12s and get connection failed message at 29s

@nassimus26
Copy link
Author

Ok @hyue7 thank you, in this case I don’t know why the Samsung tester report this problem since it happening only on my slow emulator, I was about to abort this version, but I will re-submit it once again , thanks again for your time

@nassimus26
Copy link
Author

nassimus26 commented Mar 29, 2023

@hyue7 the last possible case is that the problem is in my app and not in the player, an app which working fine on others platforms and the networks issues are managed with the same shared code, could you (if you want) try my app on your TV or simulator, https://raw.githubusercontent.com/nassimus26/naviptv/main/apks/com.agiprod.naviptv-3.4.6.tpk

Just click on the Admin Profil, then add the DEMO provider, then select any Kid channel, then disable the network, after 2 or 3 seconds the bottom player control panel should appear showing ( Retryng..., Connecting ....)

If you have no issue, it means ... I have no idea .

@nassimus26
Copy link
Author

Hi @hyue7 did you try with the live stream url which I used ?

Yes, I tried this: https://stitcheraws.unreel.me/wse-node02.powr.com/live/5bf225aed5eeee0f5a4094bd/playlist.m3u8 disconnect network in 12s and get connection failed message at 29s

Actually what you describe it happens sometimes, the error message comes after a 17 seconds of same position, but most of the time the error message never comes, at least on my emulator.

And between the 12 seconds and the 29 seconds, the player did continue to play ( already buffered ) or it was stopped ? ( 17 seconds is too long to create a new temporary link , the live stream which I sent you doesn’t use temporary link but paid Iptv providers do )

@nassimus26
Copy link
Author

@hyue7 in my last version I already added a timer, if the position is not changing for more than 2 seconds, I consider that a stream error had occurred, this should reduce the risk of not handling the disconnection ( even if the player doesn’t send the error ).

@hyue7
Copy link
Collaborator

hyue7 commented Mar 29, 2023

Just click on the Admin Profil, then add the DEMO provider, then select any Kid channel, then disable the network, after 2 or 3 seconds the bottom player control panel should appear showing ( Retryng..., Connecting ....)

after add the DEMO provider, nothing happen, i can't find any Kid channel. And your app i can't launch on emulator....

@hyue7
Copy link
Collaborator

hyue7 commented Mar 29, 2023

And between the 12 seconds and the 29 seconds, the player did continue to play ( already buffered ) or it was stopped ?

player will play buffer, the video position stopped at 29s, that means buffer end at 29s, and then connection failed

@hyue7
Copy link
Collaborator

hyue7 commented Mar 29, 2023

@hyue7 No the true problem is not just the network status, most Iptv providers use temporary stream link, so when the link reach the end we need to get the error as quickly as possible to generate a new link

Do you want to player send complete message to app when stream completed? But it is not an error.... what do you actually want?

@nassimus26
Copy link
Author

Hi @hyue7 , the end of the stream is not an error but the isPlaying variable should be false.

@rajada1
Copy link

rajada1 commented Aug 21, 2024

Hi @hyue7 did you try with the live stream url which I used ?

Yes, I tried this: https://stitcheraws.unreel.me/wse-node02.powr.com/live/5bf225aed5eeee0f5a4094bd/playlist.m3u8 disconnect network in 12s and get connection failed message at 29s

Actually what you describe it happens sometimes, the error message comes after a 17 seconds of same position, but most of the time the error message never comes, at least on my emulator.

And between the 12 seconds and the 29 seconds, the player did continue to play ( already buffered ) or it was stopped ? ( 17 seconds is too long to create a new temporary link , the live stream which I sent you doesn’t use temporary link but paid Iptv providers do )

What player do you use and how do you use it to play
.m3u8?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants