Find and present music videos using YouTube. More...
Public Member Functions | |
| None | __init__ (self, SecretManagerIf|None secret_manager=None, *, str api_key_secret_name="YOUTUBE_API_KEY", int max_search_results=10, str region_code="US", str host="127.0.0.1", int port=8768, bool fullscreen=False, str|None chromium_executable=None, bool software_rendering=False, str|None window_class=None, bool show_return_button=True) |
| Create a YouTube music-video backend. | |
| int|None | browser_process_id (self) |
| Return the active browser PID for X11 embedding. | |
| MusicVideo|None | find_video (self, MusicVideoQuery query) |
| Find the best matching music video. | |
| bool | play_video (self, MusicVideo video, int position_ms=0) |
| Present the selected music video. | |
| None | stop_video (self) |
| Stop the active video presentation. | |
| bool | is_video_active (self) |
| Return whether video presentation is active. | |
Find and present music videos using YouTube.
| None video.youtube_music_video.YouTubeMusicVideo.__init__ | ( | self, | |
| SecretManagerIf | None | secret_manager = None, | ||
| * | , | ||
| str | api_key_secret_name = "YOUTUBE_API_KEY", | ||
| int | max_search_results = 10, | ||
| str | region_code = "US", | ||
| str | host = "127.0.0.1", | ||
| int | port = 8768, | ||
| bool | fullscreen = False, | ||
| str | None | chromium_executable = None, | ||
| bool | software_rendering = False, | ||
| str | None | window_class = None, | ||
| bool | show_return_button = True ) |
Create a YouTube music-video backend.
| secret_manager | Optional secret provider used to resolve the YouTube API key. |
| api_key_secret_name | Secret name used to retrieve the YouTube Data API key. |
| max_search_results | Maximum number of YouTube search results to rank. |
| region_code | Two-letter country code used for YouTube search results. |
| host | Local HTTP host used for the embedded player page. |
| port | Local HTTP port used for the embedded player page. |
| fullscreen | Whether Chromium should request fullscreen presentation. |
| chromium_executable | Optional explicit Chromium-compatible browser executable. |
| software_rendering | Whether browser GPU acceleration should be disabled. |
| window_class | Optional X11 browser class used by ORC reparenting. |
| show_return_button | Whether the hosted page renders its standalone RETURN button. |
| MusicVideo | None video.youtube_music_video.YouTubeMusicVideo.find_video | ( | self, | |
| MusicVideoQuery | query ) |
Find the best matching music video.
| query | Track metadata used to search for a video. |
Reimplemented from video.music_video_if.MusicVideoIf.
| bool video.youtube_music_video.YouTubeMusicVideo.is_video_active | ( | self | ) |
Return whether video presentation is active.
Reimplemented from video.music_video_if.MusicVideoIf.
| bool video.youtube_music_video.YouTubeMusicVideo.play_video | ( | self, | |
| MusicVideo | video, | ||
| int | position_ms = 0 ) |
Present the selected music video.
| video | Video selected for presentation. |
| position_ms | Initial playback position in milliseconds. |
Reimplemented from video.music_video_if.MusicVideoIf.