|
1 |
| -#! /usr/bin/env python3 |
| 1 | +#!/usr/bin/env python |
2 | 2 | # -*- coding: utf-8 -*-
|
3 | 3 |
|
4 | 4 | # Example of using PyCocoa <https://PyPI.org/project/PyCocoa> to create a
|
5 | 5 | # window, table and an application menu to run a video using VLC on macOS.
|
6 | 6 | # The Python-VLC binding <https://PyPI.Python.org/pypi/python-vlc> and the
|
7 | 7 | # corresponding VLC App, see <https://www.VideoLan.org/index.html>.
|
8 | 8 |
|
9 |
| -# PyCocoa version 21.8.18 or later must be installed. |
| 9 | +# PyCocoa version 21.11.02 or later must be installed (on macOS Monterey) |
10 | 10 |
|
11 |
| -# This VLC player has been tested with VLC 3.0.10-12, 3.0.6-8, 3.0.4, |
| 11 | +# This VLC player has been tested with VLC 3.0.10-16, 3.0.6-8, 3.0.4, |
12 | 12 | # 3.0.1-2, 2.2.8 and 2.2.6 and the compatible vlc.py Python-VLC binding
|
13 |
| -# using 64-bit Python 3.10.0.rc1, 3.9.6, 3.9.0-1, 3.8.10, 3.8.6, 3.7.0-4, |
14 |
| -# 3.6.4-5 and 2.7.14-18 on macOS 11.5.2 Big Sur (aka 10.16), 10.15.6 |
15 |
| -# Catalina, 10.14.6 Mojave and 10.13.4-6 High Sierra. This player |
16 |
| -# does not work with PyPy <https://PyPy.org> nor with Intel(R) Python |
17 |
| -# <https://Software.Intel.com/en-us/distribution-for-python>. Python |
18 |
| -# 3.10.0rc1, 3.9.6 and macOS' Python 2.7.16 run on Apple Silicon (C{arm64}), |
19 |
| -# all other Python versions run on Intel (C{x86_64}) or I{emulated} Intel |
20 |
| -# (C{"arm64_x86_64"}, see function C{pycocoa.machine}). |
| 13 | +# using 64-bit Python 3.10.0, 3.9.6, 3.9.0-1, 3.8.10, 3.8.6, 3.7.0-4, |
| 14 | +# 3.6.4-5 and 2.7.14-18 on macOS 12.0.1 Monterey, 11.5.2-6.1 Big Sur |
| 15 | +# (aka 10.16), 10.15.6 Catalina, 10.14.6 Mojave and 10.13.4-6 High Sierra. |
| 16 | +# This player does not work with PyPy <https://PyPy.org> nor with Intel(R) |
| 17 | +# Python <https://Software.Intel.com/en-us/distribution-for-python>. |
| 18 | + |
| 19 | +# Python 3.10.0, 3.9.6 and macOS' Python 2.7.16 run on Apple Silicon |
| 20 | +# (C{arm64} I{natively}), all other Python versions run on Intel (C{x86_64}) |
| 21 | +# or I{emulated} Intel (C{"arm64_x86_64"}, see function C{pycocoa.machine}). |
21 | 22 |
|
22 | 23 | # MIT License <https://OpenSource.org/licenses/MIT>
|
23 | 24 | #
|
@@ -45,7 +46,7 @@ def _PyPI(package):
|
45 | 46 | return 'see <https://PyPI.org/project/%s>' % (package,)
|
46 | 47 |
|
47 | 48 | __all__ = ('AppVLC',) # PYCHOK expected
|
48 |
| -__version__ = '21.08.18' |
| 49 | +__version__ = '21.11.02' |
49 | 50 |
|
50 | 51 | try:
|
51 | 52 | import vlc
|
@@ -479,11 +480,16 @@ def _resizer(self): # adjust aspect ratio and marquee height
|
479 | 480 | else:
|
480 | 481 | Thread(target=self._sizer).start()
|
481 | 482 |
|
482 |
| - def _sizer(self, secs=0.1): |
| 483 | + def _sizer(self, secs=0.25): |
483 | 484 | while True:
|
484 |
| - w, h = self.player.video_get_size(0) |
| 485 | + p = self.player |
| 486 | + # wiggle the video to fill the window |
| 487 | + s = p.video_get_scale() |
| 488 | + p.video_set_scale(0.0 if s else 1.0) |
| 489 | + p.video_set_scale(s) |
485 | 490 | # the first call(s) returns (0, 0),
|
486 | 491 | # subsequent calls return (w, h)
|
| 492 | + w, h = p.video_get_size(0) |
487 | 493 | if h > 0 and w > 0:
|
488 | 494 | # window's contents' aspect ratio
|
489 | 495 | self.window.ratio = self.sized = w, h
|
|
0 commit comments