PyObjC DVDPlayback Framework
The `pyobjc-framework-dvdplayback` library provides Python bindings for the macOS DVDPlayback framework, allowing Python applications to interact with DVD playback functionalities. As part of the broader PyObjC project (current version 12.1), which bridges Python and Objective-C, this specific framework wrapper is now deprecated by Apple. PyObjC generally follows a regular release cadence, updating bindings for new macOS SDKs and Python versions.
Warnings
- deprecated The DVDPlayback framework itself is deprecated by Apple and marked as such in PyObjC documentation. Its functionality may be limited or unavailable on recent macOS versions and it should not be used for new development.
- breaking PyObjC versions periodically drop support for older Python versions. For instance, PyObjC 11 dropped Python 3.8 support, and PyObjC 12.0 dropped Python 3.9 support.
- breaking PyObjC 11.1 aligned its behavior with clang's Automatic Reference Counting (ARC) for initializer methods, meaning methods in the 'init' family now correctly steal a reference to `self` and return a new reference. This is a significant change in reference counting.
- gotcha Changes in PyObjC 10.3 affected how `__init__` is handled when a user-defined `__new__` method is present. While 10.3 initially removed support for calling `__init__` in such cases, 10.3.1 reintroduced it if the class (or a superclass) explicitly implements `__new__`. Code relying on PyObjC's `__new__` still cannot use `__init__`.
- gotcha Installation of PyObjC (and its framework wrappers) typically requires the Xcode Command Line Tools to be installed on macOS. Without them, compilation errors may occur.
- breaking Older, deprecated macOS frameworks may be entirely removed from PyObjC bindings when Apple removes them from the SDK. For example, the 'IMServicePlugIn' bindings were removed in PyObjC 10.0 because the framework was deprecated in macOS 10.13 and removed in macOS 14. This is a general policy that applies to deprecated frameworks like DVDPlayback.
Install
-
pip install pyobjc-framework-dvdplayback
Imports
- DVDGetScanRate
from DVDPlayback import DVDGetScanRate
Quickstart
from Foundation import NSLog
from DVDPlayback import DVDGetScanRate
# Note: The DVDPlayback framework and its APIs are deprecated by Apple.
# This example is illustrative and may not function on recent macOS versions or
# without a DVD drive/mounted DVD image.
try:
scan_rate = DVDGetScanRate()
NSLog(f"Current DVD scan rate: %{{float}}", scan_rate)
except Exception as e:
NSLog(f"Failed to get DVD scan rate: %{{@}}", str(e))