flet-video 0.2.0.dev76__tar.gz → 0.2.0.dev84__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flet-video might be problematic. Click here for more details.

Files changed (25) hide show
  1. {flet_video-0.2.0.dev76/src/flet_video.egg-info → flet_video-0.2.0.dev84}/PKG-INFO +1 -1
  2. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/pyproject.toml +36 -14
  3. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video/__init__.py +9 -0
  4. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video/types.py +14 -12
  5. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video/video.py +63 -37
  6. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84/src/flet_video.egg-info}/PKG-INFO +1 -1
  7. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/pubspec.lock +7 -7
  8. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/pubspec.yaml +1 -1
  9. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/LICENSE +0 -0
  10. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/README.md +0 -0
  11. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/setup.cfg +0 -0
  12. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video.egg-info/SOURCES.txt +0 -0
  13. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video.egg-info/dependency_links.txt +0 -0
  14. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video.egg-info/requires.txt +0 -0
  15. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flet_video.egg-info/top_level.txt +0 -0
  16. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/CHANGELOG.md +0 -0
  17. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/LICENSE +0 -0
  18. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/README.md +0 -0
  19. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/analysis_options.yaml +0 -0
  20. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/lib/flet_video.dart +0 -0
  21. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/lib/src/extension.dart +0 -0
  22. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/lib/src/utils/file_utils_io.dart +0 -0
  23. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/lib/src/utils/file_utils_web.dart +0 -0
  24. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/lib/src/utils/video.dart +0 -0
  25. {flet_video-0.2.0.dev76 → flet_video-0.2.0.dev84}/src/flutter/flet_video/lib/src/video.dart +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-video
3
- Version: 0.2.0.dev76
3
+ Version: 0.2.0.dev84
4
4
  Summary: A cross-platform video player for Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flet-video"
3
- version = "0.2.0.dev76"
3
+ version = "0.2.0.dev84"
4
4
  description = "A cross-platform video player for Flet apps."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -22,22 +22,43 @@ Issues = "https://github.com/flet-dev/flet-video/issues"
22
22
  "flutter.flet_video" = ["**/*"]
23
23
 
24
24
  [dependency-groups]
25
+ test = [
26
+ "pytest >=7.2.0",
27
+ ]
28
+ lint = [
29
+ "ruff >=0.11.7",
30
+ ]
25
31
  dev = [
26
- "pre-commit>=4.2.0",
27
- "ruff>=0.11.7",
32
+ "pre-commit >=4.2.0",
33
+ { include-group = 'lint' },
34
+ { include-group = 'test' },
35
+ ]
36
+ docs-coverage = [
37
+ "docstr-coverage >=2.3.2",
28
38
  ]
29
39
  docs = [
30
- "mkdocs",
31
- "mkdocs-material",
32
- "mkdocstrings[python]",
33
- "mkdocstrings-python-xref",
34
- "mike",
35
- "markdown>=3.6",
36
- "pymdown-extensions",
37
- "mkdocs-glightbox",
38
- "mkdocs-section-index",
39
- "griffe-modernized-annotations",
40
- "pygments>=2.16",
40
+ "mkdocs >=1.6.1",
41
+ "mkdocs-material >=9.6.15",
42
+ "mkdocstrings-python >=1.16.12",
43
+ "mkdocstrings-python-xref >=1.16.3",
44
+ "mike >=2.1.3",
45
+ "markdown >=3.6",
46
+ "pymdown-extensions >=10.16",
47
+ "mkdocs-exclude >=1.0.2",
48
+ "mkdocs-glightbox >=0.4.0",
49
+ "mkdocs-open-in-new-tab >=1.0.8",
50
+ "mkdocs-section-index >=0.3.10",
51
+ "griffe-modernized-annotations >=1.0.8",
52
+ "griffe-warnings-deprecated >=1.1.0",
53
+ "pygments >=2.16",
54
+ "markdown-exec[ansi] >=1.11.0",
55
+ "pydocstyle >=6.3.0",
56
+ "linkcheckmd >=1.4.0",
57
+ { include-group = 'docs-coverage' },
58
+ ]
59
+ all = [
60
+ { include-group = 'dev' },
61
+ { include-group = 'docs' },
41
62
  ]
42
63
 
43
64
  [build-system]
@@ -66,6 +87,7 @@ select = [
66
87
  "I"
67
88
  ]
68
89
  preview = true
90
+ pydocstyle = { convention = 'google' }
69
91
 
70
92
  [tool.ruff.format]
71
93
  quote-style = "double"
@@ -6,3 +6,12 @@ from .types import (
6
6
  VideoSubtitleTrack,
7
7
  )
8
8
  from .video import Video
9
+
10
+ __all__ = [
11
+ "PlaylistMode",
12
+ "Video",
13
+ "VideoConfiguration",
14
+ "VideoMedia",
15
+ "VideoSubtitleConfiguration",
16
+ "VideoSubtitleTrack",
17
+ ]
@@ -1,13 +1,13 @@
1
1
  from dataclasses import dataclass, field
2
2
  from enum import Enum
3
- from typing import Dict, Optional
3
+ from typing import Optional
4
4
 
5
5
  import flet as ft
6
6
 
7
7
  __all__ = [
8
8
  "PlaylistMode",
9
- "VideoMedia",
10
9
  "VideoConfiguration",
10
+ "VideoMedia",
11
11
  "VideoSubtitleConfiguration",
12
12
  "VideoSubtitleTrack",
13
13
  ]
@@ -33,10 +33,10 @@ class VideoMedia:
33
33
  resource: str
34
34
  """URI of the media resource."""
35
35
 
36
- http_headers: Optional[Dict[str, str]] = None
36
+ http_headers: Optional[dict[str, str]] = None
37
37
  """HTTP headers to be used for the media resource."""
38
38
 
39
- extras: Optional[Dict[str, str]] = None
39
+ extras: Optional[dict[str, str]] = None
40
40
  """Additional metadata for the media resource."""
41
41
 
42
42
 
@@ -46,8 +46,9 @@ class VideoConfiguration:
46
46
 
47
47
  output_driver: Optional[str] = None
48
48
  """
49
- Sets the [--vo](https://mpv.io/manual/stable/#options-vo) property on native backend.
50
-
49
+ Sets the [--vo](https://mpv.io/manual/stable/#options-vo) property
50
+ on native backend.
51
+
51
52
  The default value is platform dependent:
52
53
  - Windows, GNU/Linux, macOS & iOS : `"libmpv"`
53
54
  - Android: `"gpu"`
@@ -55,8 +56,9 @@ class VideoConfiguration:
55
56
 
56
57
  hardware_decoding_api: Optional[str] = None
57
58
  """
58
- Sets the [--hwdec](https://mpv.io/manual/stable/#options-hwdec) property on native backend.
59
-
59
+ Sets the [--hwdec](https://mpv.io/manual/stable/#options-hwdec)
60
+ property on native backend.
61
+
60
62
  The default value is platform dependent:
61
63
  - Windows, GNU/Linux, macOS & iOS : `"auto"`
62
64
  - Android: `"auto-safe"`
@@ -80,8 +82,8 @@ class VideoConfiguration:
80
82
 
81
83
  scale: ft.Number = 1.0
82
84
  """
83
- The scale for the video output.
84
- Specifying this option will cause `width` & `height` to be ignored.
85
+ The scale for the video output.
86
+ Specifying this option will cause [`width`][..] & [`height`][..] to be ignored.
85
87
  """
86
88
 
87
89
 
@@ -91,8 +93,8 @@ class VideoSubtitleTrack:
91
93
 
92
94
  src: str
93
95
  """
94
- The subtitle source.
95
-
96
+ The subtitle source.
97
+
96
98
  Supported values:
97
99
  - A URL (e.g. "https://example.com/subs.srt" or "www.example.com/sub.vtt")
98
100
  - An absolute local file path (not supported on the web platform)
@@ -21,7 +21,8 @@ class Video(ft.ConstrainedControl):
21
21
  A control that displays a video from a playlist.
22
22
 
23
23
  Raises:
24
- AssertionError: If the [`volume`][(c).] is not between `0.0` and `100.0` (inclusive).
24
+ AssertionError: If the [`volume`][(c).] is not between
25
+ `0.0` and `100.0` (inclusive).
25
26
  """
26
27
 
27
28
  playlist: list[VideoMedia] = field(default_factory=list)
@@ -31,7 +32,7 @@ class Video(ft.ConstrainedControl):
31
32
 
32
33
  title: str = "flet-video"
33
34
  """
34
- Defines the name of the underlying window & process for native backend.
35
+ Defines the name of the underlying window & process for native backend.
35
36
  This is visible inside the windows' volume mixer.
36
37
  """
37
38
 
@@ -47,8 +48,9 @@ class Video(ft.ConstrainedControl):
47
48
 
48
49
  wakelock: bool = True
49
50
  """
50
- Whether to acquire wake lock while playing the video.
51
- When `True`, device's display will not go to standby/sleep while the video is playing.
51
+ Whether to acquire wake lock while playing the video.
52
+ When `True`, device's display will not go to standby/sleep while
53
+ the video is playing.
52
54
  """
53
55
 
54
56
  autoplay: bool = False
@@ -79,9 +81,10 @@ class Video(ft.ConstrainedControl):
79
81
  volume: ft.Number = 100.0
80
82
  """
81
83
  Defines the volume of the video player.
82
-
84
+
83
85
  Note:
84
- It's value ranges between `0.0` to `100.0` (inclusive), where `0.0` is muted and `100.0` is the maximum volume.
86
+ It's value ranges between `0.0` to `100.0` (inclusive), where `0.0`
87
+ is muted and `100.0` is the maximum volume.
85
88
  An exception will be raised if the value is outside this range.
86
89
  """
87
90
 
@@ -90,7 +93,7 @@ class Video(ft.ConstrainedControl):
90
93
  Defines the playback rate of the video player.
91
94
  """
92
95
 
93
- alignment: ft.Alignment = field(default_factory=lambda: ft.Alignment.center())
96
+ alignment: ft.Alignment = field(default_factory=lambda: ft.Alignment.CENTER)
94
97
  """
95
98
  Defines the Alignment of the viewport.
96
99
  """
@@ -98,10 +101,12 @@ class Video(ft.ConstrainedControl):
98
101
  filter_quality: ft.FilterQuality = ft.FilterQuality.LOW
99
102
  """
100
103
  Filter quality of the texture used to render the video output.
101
-
102
- Note:
103
- Android was reported to show blurry images when using `ft.FilterQuality.HIGH`.
104
- Prefer the usage of `ft.FilterQuality.MEDIUM` on this platform.
104
+
105
+ Note:
106
+ Android was reported to show blurry images when using
107
+ [`FilterQuality.HIGH`][flet.FilterQuality.HIGH].
108
+ Prefer the usage of [`FilterQuality.MEDIUM`][flet.FilterQuality.MEDIUM]
109
+ on this platform.
105
110
  """
106
111
 
107
112
  pause_upon_entering_background_mode: bool = True
@@ -111,8 +116,9 @@ class Video(ft.ConstrainedControl):
111
116
 
112
117
  resume_upon_entering_foreground_mode: bool = False
113
118
  """
114
- Whether to resume the video when application enters foreground mode.
115
- Has effect only if `pause_upon_entering_background_mode` is also set to `True`.
119
+ Whether to resume the video when application enters foreground mode.
120
+ Has effect only if [`pause_upon_entering_background_mode`][..] is also set to
121
+ `True`.
116
122
  """
117
123
 
118
124
  pitch: ft.Number = 1.0
@@ -139,35 +145,39 @@ class Video(ft.ConstrainedControl):
139
145
  Defines the subtitle track for the video player.
140
146
  """
141
147
 
142
- on_load: ft.OptionalControlEventHandler["Video"] = None
148
+ on_load: Optional[ft.ControlEventHandler["Video"]] = None
143
149
  """Fires when the video player is initialized and ready for playback."""
144
150
 
145
- on_enter_fullscreen: ft.OptionalControlEventHandler["Video"] = None
151
+ on_enter_fullscreen: Optional[ft.ControlEventHandler["Video"]] = None
146
152
  """Fires when the video player enters fullscreen."""
147
153
 
148
- on_exit_fullscreen: ft.OptionalControlEventHandler["Video"] = None
154
+ on_exit_fullscreen: Optional[ft.ControlEventHandler["Video"]] = None
149
155
  """Fires when the video player exits fullscreen"""
150
156
 
151
- on_error: ft.OptionalControlEventHandler["Video"] = None
157
+ on_error: Optional[ft.ControlEventHandler["Video"]] = None
152
158
  """
153
159
  Fires when an error occurs.
154
-
155
- Event handler argument's `data` property contains information about the error.
160
+
161
+ Event handler argument's [`data`][flet.Event.data] property contains
162
+ information about the error.
156
163
  """
157
164
 
158
- on_complete: ft.OptionalControlEventHandler["Video"] = None
165
+ on_complete: Optional[ft.ControlEventHandler["Video"]] = None
159
166
  """Fires when a video player completes."""
160
167
 
161
- on_track_change: ft.OptionalControlEventHandler["Video"] = None
168
+ on_track_change: Optional[ft.ControlEventHandler["Video"]] = None
162
169
  """
163
170
  Fires when a video track changes.
164
-
165
- Event handler argument's `data` property contains the index of the new track.
171
+
172
+ Event handler argument's [`data`][flet.Event.data] property contains
173
+ the index of the new track.
166
174
  """
167
175
 
168
176
  def before_update(self):
169
177
  super().before_update()
170
- assert 0 <= self.volume <= 100, "volume must be between 0 and 100 inclusive"
178
+ assert 0 <= self.volume <= 100, (
179
+ f"volume must be between 0 and 100 inclusive, got {self.volume}"
180
+ )
171
181
 
172
182
  def play(self):
173
183
  """Starts playing the video."""
@@ -208,48 +218,58 @@ class Video(ft.ConstrainedControl):
208
218
  return self._invoke_method_async("stop")
209
219
 
210
220
  def next(self):
211
- """Jumps to the next `VideoMedia` in the `playlist`."""
221
+ """Jumps to the next `VideoMedia` in the [`playlist`][..]."""
212
222
  asyncio.create_task(self.next_async())
213
223
 
214
224
  def next_async(self):
215
- """Jumps to the next `VideoMedia` in the `playlist`."""
225
+ """Jumps to the next `VideoMedia` in the [`playlist`][..]."""
216
226
  return self._invoke_method_async("next")
217
227
 
218
228
  def previous(self):
219
- """Jumps to the previous `VideoMedia` in the `playlist`."""
229
+ """Jumps to the previous `VideoMedia` in the [`playlist`][..]."""
220
230
  asyncio.create_task(self.previous_async())
221
231
 
222
232
  def previous_async(self):
223
- """Jumps to the previous `VideoMedia` in the `playlist`."""
233
+ """Jumps to the previous `VideoMedia` in the [`playlist`][..]."""
224
234
  return self._invoke_method_async("previous")
225
235
 
226
236
  def seek(self, position: ft.DurationValue):
227
237
  """
228
- Seeks the currently playing `VideoMedia` from the `playlist` at the specified `position`.
238
+ Seeks the currently playing `VideoMedia` from the
239
+ [`playlist`][..] at the specified `position`.
229
240
  """
230
241
  asyncio.create_task(self.seek_async(position))
231
242
 
232
243
  def seek_async(self, position: ft.DurationValue):
233
244
  """
234
- Seeks the currently playing `VideoMedia` from the `playlist` at the specified `position`.
245
+ Seeks the currently playing `VideoMedia` from the
246
+ [`playlist`][..] at the specified `position`.
235
247
  """
236
- return self._invoke_method_async("seek", {"position": position})
248
+ return self._invoke_method_async(
249
+ "seek",
250
+ {"position": position},
251
+ )
237
252
 
238
253
  def jump_to(self, media_index: int):
239
254
  """
240
- Jumps to the `VideoMedia` at the specified `media_index` in the `playlist`.
255
+ Jumps to the `VideoMedia` at the specified `media_index`
256
+ in the [`playlist`][..].
241
257
  """
242
258
  asyncio.create_task(self.jump_to_async(media_index))
243
259
 
244
260
  async def jump_to_async(self, media_index: int):
245
261
  """
246
- Jumps to the `VideoMedia` at the specified `media_index` in the `playlist`.
262
+ Jumps to the `VideoMedia` at the specified `media_index`
263
+ in the [`playlist`][..].
247
264
  """
248
265
  assert self.playlist[media_index], "media_index is out of range"
249
266
  if media_index < 0:
250
267
  # dart doesn't support negative indexes
251
268
  media_index = len(self.playlist) + media_index
252
- await self._invoke_method_async("jump_to", {"media_index": media_index})
269
+ await self._invoke_method_async(
270
+ method_name="jump_to",
271
+ arguments={"media_index": media_index},
272
+ )
253
273
 
254
274
  def playlist_add(self, media: VideoMedia):
255
275
  """Appends/Adds the provided `media` to the `playlist`."""
@@ -258,7 +278,10 @@ class Video(ft.ConstrainedControl):
258
278
  async def playlist_add_async(self, media: VideoMedia):
259
279
  """Appends/Adds the provided `media` to the `playlist`."""
260
280
  assert media.resource, "media has no resource"
261
- await self._invoke_method_async("playlist_add", {"media": media})
281
+ await self._invoke_method_async(
282
+ method_name="playlist_add",
283
+ arguments={"media": media},
284
+ )
262
285
  self.playlist.append(media)
263
286
 
264
287
  def playlist_remove(self, media_index: int):
@@ -268,7 +291,10 @@ class Video(ft.ConstrainedControl):
268
291
  async def playlist_remove_async(self, media_index: int):
269
292
  """Removes the provided `media` from the `playlist`."""
270
293
  assert self.playlist[media_index], "index out of range"
271
- await self._invoke_method_async("playlist_remove", {"media_index": media_index})
294
+ await self._invoke_method_async(
295
+ method_name="playlist_remove",
296
+ arguments={"media_index": media_index},
297
+ )
272
298
  self.playlist.pop(media_index)
273
299
 
274
300
  async def is_playing_async(self) -> bool:
@@ -282,7 +308,7 @@ class Video(ft.ConstrainedControl):
282
308
  """
283
309
  Returns:
284
310
  `True` if video player has reached the end of
285
- the currently playing media, `False` otherwise.
311
+ the currently playing media, `False` otherwise.
286
312
  """
287
313
  return await self._invoke_method_async("is_completed")
288
314
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: flet-video
3
- Version: 0.2.0.dev76
3
+ Version: 0.2.0.dev84
4
4
  Summary: A cross-platform video player for Flet apps.
5
5
  Author-email: Flet contributors <hello@flet.dev>
6
6
  License-Expression: Apache-2.0
@@ -150,7 +150,7 @@ packages:
150
150
  description:
151
151
  path: "packages/flet"
152
152
  ref: main
153
- resolved-ref: b996d06ff462b88f5b31d6cceafac34ea6f57968
153
+ resolved-ref: cf8823c5d766ea7866480986aa3ee871f4091e78
154
154
  url: "https://github.com/flet-dev/flet.git"
155
155
  source: git
156
156
  version: "0.70.0"
@@ -171,10 +171,10 @@ packages:
171
171
  dependency: "direct dev"
172
172
  description:
173
173
  name: flutter_lints
174
- sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04
174
+ sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
175
175
  url: "https://pub.dev"
176
176
  source: hosted
177
- version: "2.0.3"
177
+ version: "3.0.2"
178
178
  flutter_localizations:
179
179
  dependency: transitive
180
180
  description: flutter
@@ -290,10 +290,10 @@ packages:
290
290
  dependency: transitive
291
291
  description:
292
292
  name: lints
293
- sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452"
293
+ sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290
294
294
  url: "https://pub.dev"
295
295
  source: hosted
296
- version: "2.1.1"
296
+ version: "3.0.0"
297
297
  logging:
298
298
  dependency: transitive
299
299
  description:
@@ -943,10 +943,10 @@ packages:
943
943
  dependency: transitive
944
944
  description:
945
945
  name: window_manager
946
- sha256: "51d50168ab267d344b975b15390426b1243600d436770d3f13de67e55b05ec16"
946
+ sha256: "7eb6d6c4164ec08e1bf978d6e733f3cebe792e2a23fb07cbca25c2872bfdbdcd"
947
947
  url: "https://pub.dev"
948
948
  source: hosted
949
- version: "0.5.0"
949
+ version: "0.5.1"
950
950
  window_to_front:
951
951
  dependency: transitive
952
952
  description:
@@ -22,4 +22,4 @@ dependencies:
22
22
  dev_dependencies:
23
23
  flutter_test:
24
24
  sdk: flutter
25
- flutter_lints: ^2.0.0
25
+ flutter_lints: ^3.0.0