OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
video.youtube_music_video.YouTubeMusicVideo Class Reference

Find and present music videos using YouTube. More...

Inheritance diagram for video.youtube_music_video.YouTubeMusicVideo:
video.music_video_if.MusicVideoIf

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.

Detailed Description

Find and present music videos using YouTube.

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
secret_managerOptional secret provider used to resolve the YouTube API key.
api_key_secret_nameSecret name used to retrieve the YouTube Data API key.
max_search_resultsMaximum number of YouTube search results to rank.
region_codeTwo-letter country code used for YouTube search results.
hostLocal HTTP host used for the embedded player page.
portLocal HTTP port used for the embedded player page.
fullscreenWhether Chromium should request fullscreen presentation.
chromium_executableOptional explicit Chromium-compatible browser executable.
software_renderingWhether browser GPU acceleration should be disabled.
window_classOptional X11 browser class used by ORC reparenting.
show_return_buttonWhether the hosted page renders its standalone RETURN button.

Member Function Documentation

◆ find_video()

MusicVideo | None video.youtube_music_video.YouTubeMusicVideo.find_video ( self,
MusicVideoQuery query )

Find the best matching music video.

Parameters
queryTrack metadata used to search for a video.
Returns
Best matching video, or None when no match is available.

Reimplemented from video.music_video_if.MusicVideoIf.

◆ is_video_active()

bool video.youtube_music_video.YouTubeMusicVideo.is_video_active ( self)

Return whether video presentation is active.

Returns
True while a video presentation is active.

Reimplemented from video.music_video_if.MusicVideoIf.

◆ play_video()

bool video.youtube_music_video.YouTubeMusicVideo.play_video ( self,
MusicVideo video,
int position_ms = 0 )

Present the selected music video.

Parameters
videoVideo selected for presentation.
position_msInitial playback position in milliseconds.
Returns
True when video playback was started.

Reimplemented from video.music_video_if.MusicVideoIf.


The documentation for this class was generated from the following file:
  • controllers/video/youtube_music_video.py