diff --git a/lib/widgets/device_grid/video_status_label.dart b/lib/widgets/device_grid/video_status_label.dart index ee8f0833..9daeae9a 100644 --- a/lib/widgets/device_grid/video_status_label.dart +++ b/lib/widgets/device_grid/video_status_label.dart @@ -69,19 +69,12 @@ class _VideoStatusLabelState extends State { final overlayKey = GlobalKey(debugLabel: 'Label Overlay'); bool get isLoading => widget.video.lastImageUpdate == null; - String get _source => widget.video.player.dataSource!; - bool get isLive => - widget.video.player.dataSource != null && - // It is only LIVE if it starts with rtsp or is hls - (_source.startsWith('rtsp') || - _source.contains('media/mjpeg') || - _source.contains('.m3u8') /* hls */); VideoLabel get status => widget.video.error != null ? VideoLabel.error : isLoading ? VideoLabel.loading - : !isLive + : !widget.video.player.isLive ? VideoLabel.recorded : widget.video.player.isImageOld ? VideoLabel.timedOut @@ -105,7 +98,6 @@ class _VideoStatusLabelState extends State { device: widget.device, video: widget.video, label: status, - isLive: isLive, event: widget.event, ); final minHeight = label.buildTextSpans(context).length * 15; @@ -248,7 +240,6 @@ class _DeviceVideoInfo extends StatelessWidget { final Device device; final VideoViewInheritance video; final VideoLabel label; - final bool isLive; final Event? event; @@ -256,7 +247,6 @@ class _DeviceVideoInfo extends StatelessWidget { required this.device, required this.video, required this.label, - required this.isLive, required this.event, }); @@ -271,7 +261,7 @@ class _DeviceVideoInfo extends StatelessWidget { title: loc.server, data: '${device.server.name} (${device.id})', ); - if (isLive) { + if (video.player.isLive) { return [ name, server, diff --git a/packages/unity_video_player/unity_video_player_platform_interface/lib/unity_video_player_platform_interface.dart b/packages/unity_video_player/unity_video_player_platform_interface/lib/unity_video_player_platform_interface.dart index 6d67b644..60c8cf89 100644 --- a/packages/unity_video_player/unity_video_player_platform_interface/lib/unity_video_player_platform_interface.dart +++ b/packages/unity_video_player/unity_video_player_platform_interface/lib/unity_video_player_platform_interface.dart @@ -437,12 +437,21 @@ abstract class UnityVideoPlayer with ChangeNotifier { /// The video is considered late if the current position is more than 1.5 /// seconds after the last image update. bool get isLate { - if (lastImageUpdate == null) return false; + if (dataSource == null || lastImageUpdate == null || !isLive) return false; final now = DateTime.now(); final diff = now.difference(lastImageUpdate!); return diff.inMilliseconds > 1500; } + /// Whether the video is a live stream. + bool get isLive => + // TODO(bdlukaa): do a better checking of this + dataSource != null && + // It is only LIVE if it starts with rtsp or is hls + (dataSource!.startsWith('rtsp') || + dataSource!.contains('media/mjpeg') || + dataSource!.contains('.m3u8') /* hls */); + void _handleLateVideo() { switch (lateVideoBehavior) { case LateVideoBehavior.automatic: diff --git a/pubspec.lock b/pubspec.lock index 93b2ad4e..3b8be49a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,26 +5,26 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "6a0ad72b2bcdb461749e40c01c478212a78db848dfcb2f10f2a461988bc5fb29" + sha256: "1a52f1afae8ab7ac4741425114713bdbba802f1ce1e0648e167ffcc6e05e96cf" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.3.21" animations: dependency: "direct main" description: name: animations - sha256: ef57563eed3620bd5d75ad96189846aca1e033c0c45fc9a7d26e80ab02b88a70 + sha256: d3d6dcfb218225bbe68e87ccf6378bbb2e32a94900722c5f81611dad089911cb url: "https://pub.dev" source: hosted - version: "2.0.8" + version: "2.0.11" app_links: dependency: "direct main" description: name: app_links - sha256: "1e1e917ed211d867e69c125ead63f0cb2c8dc5cf54b8a58ad6bf27647ce5cef8" + sha256: "4e392b5eba997df356ca6021f28431ce1cfeb16758699553a94b13add874a3bb" url: "https://pub.dev" source: hosted - version: "3.5.0-beta.3" + version: "3.5.0" archive: dependency: transitive description: @@ -125,10 +125,10 @@ packages: dependency: "direct main" description: name: connectivity_plus - sha256: b502a681ba415272ecc41400bd04fe543ed1a62632137dc84d25a91e7746f55f + sha256: "224a77051d52a11fbad53dd57827594d3bd24f945af28bd70bab376d68d437f0" url: "https://pub.dev" source: hosted - version: "5.0.1" + version: "5.0.2" connectivity_plus_platform_interface: dependency: transitive description: @@ -181,10 +181,10 @@ packages: dependency: "direct main" description: name: device_info_plus - sha256: "7035152271ff67b072a211152846e9f1259cf1be41e34cd3e0b5463d2d6b8419" + sha256: "77f757b789ff68e4eaf9c56d1752309bd9f7ad557cb105b938a7f8eb89e59110" url: "https://pub.dev" source: hosted - version: "9.1.0" + version: "9.1.2" device_info_plus_platform_interface: dependency: transitive description: @@ -197,10 +197,10 @@ packages: dependency: "direct main" description: name: dio - sha256: "417e2a6f9d83ab396ec38ff4ea5da6c254da71e4db765ad737a42af6930140b7" + sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3" url: "https://pub.dev" source: hosted - version: "5.3.3" + version: "5.4.0" duration: dependency: "direct main" description: @@ -237,58 +237,66 @@ packages: dependency: "direct main" description: name: file_picker - sha256: "903dd4ba13eae7cef64acc480e91bf54c3ddd23b5b90b639c170f3911e489620" + sha256: "4e42aacde3b993c5947467ab640882c56947d9d27342a5b6f2895b23956954a6" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "6.1.1" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: "239e4ac688674a7e7b5476fd16b0d8e2b5a453d464f32091af3ce1df4ebb7316" + sha256: "7e049e32a9d347616edb39542cf92cd53fdb4a99fb6af0a0bff327c14cd76445" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.25.4" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + sha256: c437ae5d17e6b5cc7981cf6fd458a5db4d12979905f9aafd1fea930428a9fe63 url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "5.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "4cf4d2161530332ddc3c562f19823fb897ff37a9a774090d28df99f47370e973" + sha256: "57e61d6010e253b36d38191cefd6199d7849152cdcd234b61ca290cdb278a0ba" url: "https://pub.dev" source: hosted - version: "2.7.0" + version: "2.11.4" firebase_messaging: dependency: "direct main" description: name: firebase_messaging - sha256: b300f728021b52018e4fc5aed326e71f876ef58219d7f10754370f424a338929 + sha256: "9c97b20c012542252a8853f11334efd833ddae83551fe37d27f87d885c655038" url: "https://pub.dev" source: hosted - version: "14.4.1" + version: "14.7.15" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface - sha256: "3585b447d9a8c8a22ab6c14ffe57c64c0fcd9656e437e3dd226ef88a5f334b84" + sha256: d464b255e922c7915dc4b0ebc305ebad4e1f130519bee3d6e568ef2ea1613a4b url: "https://pub.dev" source: hosted - version: "4.3.1" + version: "4.5.23" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web - sha256: "9e95a7694a1a24a8cdb047351c5a75583c84767d82ce74c52647ee9f81b425ae" + sha256: f3f71aeec719ec1fe2c99f75cd74d00d33f1c240cf1e402cc9d43883e84f935a url: "https://pub.dev" source: hosted - version: "3.3.1" + version: "3.6.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -417,10 +425,10 @@ packages: dependency: "direct main" description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.0" http_parser: dependency: transitive description: @@ -623,10 +631,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" + sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79" url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "5.0.1" package_info_plus_platform_interface: dependency: transitive description: @@ -663,10 +671,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_android: dependency: transitive description: @@ -711,42 +719,50 @@ packages: dependency: "direct main" description: name: permission_handler - sha256: ad65ba9af42a3d067203641de3fd9f547ded1410bad3b84400c2b4899faede70 + sha256: "3c84d49f0a5e1915364707159ab71f11b3b8a429532176d3a6248a45718ad4f9" url: "https://pub.dev" source: hosted - version: "11.0.0" + version: "11.2.1" permission_handler_android: dependency: transitive description: name: permission_handler_android - sha256: f23cfe9af0d49c6b9fd8a8b09f7b3301ca7e346204939b5afef4404d36d2608f + sha256: a5ebaa420cee8fd880ef10dedd42c6b3f493e7dbe27d7e0a7e1798669373082a url: "https://pub.dev" source: hosted - version: "11.0.1" + version: "12.0.4" permission_handler_apple: dependency: transitive description: name: permission_handler_apple - sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5" + sha256: "6ca25ee52518a8a26e80aaefe3c71caf6e2dfd809c1b20900d0882df6faed36e" url: "https://pub.dev" source: hosted - version: "9.1.4" + version: "9.3.1" + permission_handler_html: + dependency: transitive + description: + name: permission_handler_html + sha256: "54bf176b90f6eddd4ece307e2c06cf977fb3973719c35a93b85cc7093eb6070d" + url: "https://pub.dev" + source: hosted + version: "0.1.1" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - sha256: f2343e9fa9c22ae4fd92d4732755bfe452214e7189afcc097380950cf567b4b2 + sha256: "5c43148f2bfb6d14c5a8162c0a712afe891f2d847f35fcff29c406b37da43c3c" url: "https://pub.dev" source: hosted - version: "3.11.5" + version: "4.1.0" permission_handler_windows: dependency: transitive description: name: permission_handler_windows - sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098 + sha256: "1a790728016f79a41216d88672dbc5df30e686e811ad4e698bfc51f76ad91f1e" url: "https://pub.dev" source: hosted - version: "0.1.3" + version: "0.2.1" petitparser: dependency: transitive description: @@ -783,10 +799,10 @@ packages: dependency: "direct main" description: name: provider - sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096" url: "https://pub.dev" source: hosted - version: "6.0.5" + version: "6.1.1" pub_semver: dependency: transitive description: @@ -1023,74 +1039,74 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "47e208a6711459d813ba18af120d9663c20bdf6985d6ad39fe165d2538378d27" + sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c url: "https://pub.dev" source: hosted - version: "6.1.14" + version: "6.2.4" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: b04af59516ab45762b2ca6da40fa830d72d0f6045cd97744450b73493fa76330 + sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" url: "https://pub.dev" source: hosted - version: "6.1.0" + version: "6.2.2" url_launcher_ios: dependency: transitive description: name: url_launcher_ios - sha256: "7c65021d5dee51813d652357bc65b8dd4a6177082a9966bc8ba6ee477baa795f" + sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03" url: "https://pub.dev" source: hosted - version: "6.1.5" + version: "6.2.4" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - sha256: b651aad005e0cb06a01dbd84b428a301916dc75f0e7ea6165f80057fee2d8e8e + sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 url: "https://pub.dev" source: hosted - version: "3.0.6" + version: "3.1.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - sha256: b55486791f666e62e0e8ff825e58a023fd6b1f71c49926483f1128d3bbd8fe88 + sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "3.1.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - sha256: "95465b39f83bfe95fcb9d174829d6476216f2d548b79c38ab2506e0458787618" + sha256: "4aca1e060978e19b2998ee28503f40b5ba6226819c2b5e3e4d1821e8ccd92198" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.3.0" url_launcher_web: dependency: transitive description: name: url_launcher_web - sha256: ba140138558fcc3eead51a1c42e92a9fb074a1b1149ed3c73e66035b2ccd94f2 + sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b url: "https://pub.dev" source: hosted - version: "2.0.19" + version: "2.2.3" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - sha256: "95fef3129dc7cfaba2bc3d5ba2e16063bb561fc6d78e63eee16162bc70029069" + sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.1.1" uuid: dependency: "direct main" description: name: uuid - sha256: b715b8d3858b6fa9f68f87d20d98830283628014750c2b09b6f516c1da4af2a7 + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 url: "https://pub.dev" source: hosted - version: "4.1.0" + version: "4.3.3" vector_math: dependency: transitive description: @@ -1167,10 +1183,10 @@ packages: dependency: "direct main" description: name: wakelock_plus - sha256: f45a6c03aa3f8322e0a9d7f4a0482721c8789cb41d555407367650b8f9c26018 + sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d url: "https://pub.dev" source: hosted - version: "1.1.3" + version: "1.1.4" wakelock_plus_platform_interface: dependency: transitive description: @@ -1207,10 +1223,10 @@ packages: dependency: "direct main" description: name: window_manager - sha256: dcc865277f26a7dad263a47d0e405d77e21f12cb71f30333a52710a408690bd7 + sha256: b3c895bdf936c77b83c5254bec2e6b3f066710c1f89c38b20b8acc382b525494 url: "https://pub.dev" source: hosted - version: "0.3.7" + version: "0.3.8" xdg_directories: dependency: transitive description: @@ -1231,10 +1247,10 @@ packages: dependency: "direct main" description: name: xml2json - sha256: "1cd5d23474f38e794fbcab262290bc638c59c985c34d29180fc4525eda24ea7d" + sha256: d97aed12d54193611c442c268155398f4170b52cfc0058aabbd79160c9c8eefb url: "https://pub.dev" source: hosted - version: "6.2.0" + version: "6.2.2" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index f12b9130..aa95c5e8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,50 +16,50 @@ dependencies: unity_video_player: path: packages/unity_video_player/unity_video_player/ - http: ^1.1.0 + http: ^1.2.0 # Dio is used by DownloadManager to show the donwload progress of the file. This is currently not possible by using http # TODO: no longer use dio and find a solution to show donwload progress using the http package - dio: ^5.3.3 + dio: ^5.4.0 - xml2json: ^6.2.0 + xml2json: ^6.2.2 auto_size_text: ^3.0.0 - animations: ^2.0.7 - provider: ^6.0.5 + animations: ^2.0.11 + provider: ^6.0.11 reorderables: ^0.6.0 flutter_simple_treeview: ^3.0.2 sliver_tools: ^0.2.12 intl: ^0.18.1 flutter_localized_locales: ^2.0.5 - duration: ^3.0.12 - firebase_core: 2.10.0 - firebase_messaging: ^14.4.1 + duration: ^3.0.13 + firebase_core: ^2.25.4 + firebase_messaging: ^14.7.15 awesome_notifications: ^0.8.2 - wakelock_plus: ^1.1.3 - app_links: ^3.5.0-beta.3 + wakelock_plus: ^1.1.4 + app_links: ^3.5.0 win32_registry: ^1.1.2 system_date_time_format: ^0.7.0 - device_info_plus: ^9.1.0 - package_info_plus: ^4.2.0 - connectivity_plus: ^5.0.1 + device_info_plus: ^9.1.2 + package_info_plus: ^5.0.1 + connectivity_plus: ^5.0.2 version: ^3.0.2 - url_launcher: ^6.1.10 + url_launcher: ^6.2.4 logging: ^1.2.0 - path_provider: ^2.0.14 - file_picker: ^6.0.0 + path_provider: ^2.1.2 + file_picker: ^6.1.1 safe_local_storage: ^1.0.0 # Hive is just used in terms of migration hive: ^2.2.3 hive_flutter: ^1.1.0 - permission_handler: ^11.0.0 - uuid: ^4.1.0 + permission_handler: ^11.1.0 + uuid: ^4.3.3 # Desktop - window_manager: ^0.3.7 + window_manager: ^0.3.8 titlebar_buttons: ^1.0.0 unity_multi_window: path: packages/unity_multi_window/ diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 3de2ce8d..98069fe5 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -25,6 +26,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("AwesomeNotificationsPluginCApi")); ConnectivityPlusWindowsPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + FirebaseCorePluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FirebaseCorePluginCApi")); MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("MediaKitLibsWindowsVideoPluginCApi")); MediaKitVideoPluginCApiRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 566b17f2..66c134bc 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -6,6 +6,7 @@ list(APPEND FLUTTER_PLUGIN_LIST app_links awesome_notifications connectivity_plus + firebase_core media_kit_libs_windows_video media_kit_video permission_handler_windows