see https://developers.google.com/youtube/iframe_api_reference
const id = getChannelID() || getOriginalAlbumID
$('ytmusic-app').navigate_(id)
note: albumID needs to be in original format, like in this link https://music.youtube.com/browse/MPREb_QzG0rdjYht1
and not like the address that it redirects to (https://music.youtube.com/playlist?list=OLAK5uy_kbMeriANLfv4JxNm5KlbyPwq1GmgCjmkY)
also you can "navigate" songs in the video player with api.loadVideoById()
/ api.loadVideoByUrl()
(both in youtube and youtube-music)
$('#movie_player').addEventListener('videodatachange', (name, data) => console.log(name, data))
$('#movie_player').addEventListener('onStateChange', console.log);
$('#movie_player').addEventListener('onAdEnd', console.log);
$('#movie_player').addEventListener('onPlaybackStartExternal', console.log);
const moviePlayer = $("#movie_player")
moviePlayer.getPlayerState() = {
1: playing
2: paused
5: not loaded yet !important // could be used to determine first song hasn't started
}
moviePlayer.playVideo
moviePlayer.pauseVideo
function playPause() {
switch (moviePlayer.getPlayerState()) {
case 1: moviePlayer.pauseVideo(); return;
case 2: moviePlayer.playVideo(); return;
}
}
moviePlayer.getVideoData() //MUSIC DATA
moviePlayer.getPlayerResponse() //FULL
moviePlayer.classList.contains("paused-mode") = video paused //("playing-mode") = video playing
moviePlayer.getProgressState() // .current, .duration and more
moviePlayer.getCurrentTime(), moviePlayer.getDuration()
moviePlayer.getPlaylistId()
$("#movie_player").getAvailableQualityLabels()
$("#movie_player").getAvailableQualityLevels()
// length -2 should be smallest
$("#movie_player").getAvailablePlaybackRates()
(8) [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]
moviePlayer.isMuted() = moviePlayer.hasOwnProperty('unMute')
if (newVolume > 0 && moviePlayer.isMuted()) {
moviePlayer.unMute();
} else if (newVolume === 0 && moviePlayer.hasOwnProperty('mute')) {
moviePlayer.mute();
}
moviePlayer.getApiInterface()
moviePlayer.getInternalApiInterface()
-
cueVideoById()
-
loadVideoById()
-
cueVideoByUrl()
-
loadVideoByUrl()
-
playVideo()
-
pauseVideo()
-
stopVideo()
-
clearVideo()
-
getVideoBytesLoaded()
-
getVideoBytesTotal()
-
getVideoLoadedFraction()
-
getVideoStartBytes()
-
cuePlaylist()
-
loadPlaylist()
-
nextVideo()
-
previousVideo()
-
playVideoAt()
-
setShuffle()
-
setLoop()
-
getPlaylist()
-
getPlaylistIndex()
-
getPlaylistId()
-
loadModule()
-
unloadModule()
-
setOption()
-
getOption()
-
getOptions()
-
mute()
-
unMute()
-
isMuted()
-
setVolume()
-
getVolume()
-
seekTo()
-
getPlayerState()
-
getPlaybackRate()
-
setPlaybackRate()
-
getAvailablePlaybackRates()
-
getPlaybackQuality()
-
setPlaybackQuality()
-
getAvailableQualityLevels()
-
getCurrentTime()
-
getDuration()
-
addEventListener()
-
removeEventListener()
-
getDebugText()
-
getVideoData()
-
addCueRange()
-
removeCueRange()
-
setSize()
-
getApiInterface()
-
destroy()
-
showVideoInfo()
-
hideVideoInfo()
-
isVideoInfoVisible()
-
getSphericalProperties()
-
setSphericalProperties()
-
getVideoEmbedCode()
-
getVideoUrl()
-
getMediaReferenceTime()
-
cueVideoByPlayerVars()
-
loadVideoByPlayerVars()
-
preloadVideoByPlayerVars()
-
seekBy()
-
mutedAutoplay()
-
showControls()
-
hideControls()
-
cancelPlayback()
-
getProgressState()
-
isInline()
-
setInline()
-
getStoryboardFormat()
-
getVideoContentRect()
-
toggleFullscreen()
-
isFullscreen()
-
getVideoStats()
-
getPlayerSize()
-
toggleSubtitles()
-
setCenterCrop()
-
handleGlobalKeyDown()
-
handleGlobalKeyUp()
-
setSizeStyle()
-
wakeUpControls()
-
cueVideoById()
-
loadVideoById()
-
cueVideoByUrl()
-
loadVideoByUrl()
-
playVideo()
-
pauseVideo()
-
stopVideo()
-
clearVideo()
-
getVideoBytesLoaded()
-
getVideoBytesTotal()
-
getVideoLoadedFraction()
-
getVideoStartBytes()
-
cuePlaylist()
-
loadPlaylist()
-
nextVideo()
-
previousVideo()
-
playVideoAt()
-
setShuffle()
-
setLoop()
-
getPlaylist()
-
getPlaylistIndex()
-
getPlaylistId()
-
loadModule()
-
unloadModule()
-
setOption()
-
getOption()
-
getOptions()
-
mute()
-
unMute()
-
isMuted()
-
setVolume()
-
getVolume()
-
seekTo()
-
getPlayerState()
-
getPlaybackRate()
-
setPlaybackRate()
-
getAvailablePlaybackRates()
-
getPlaybackQuality()
-
setPlaybackQuality()
-
getAvailableQualityLevels()
-
getCurrentTime()
-
getDuration()
-
addEventListener()
-
removeEventListener()
-
getDebugText()
-
getVideoData()
-
addCueRange()
-
removeCueRange()
-
setSize()
-
getApiInterface()
-
destroy()
-
showVideoInfo()
-
hideVideoInfo()
-
isVideoInfoVisible()
-
getSphericalProperties()
-
setSphericalProperties()
-
getVideoEmbedCode()
-
getVideoUrl()
-
getMediaReferenceTime()
-
getInternalApiInterface()
-
cueVideoByPlayerVars()
-
loadVideoByPlayerVars()
-
preloadVideoByPlayerVars()
-
getAdState()
-
sendAbandonmentPing()
-
setLoopRange()
-
getLoopRange()
-
setAutonavState()
-
seekToLiveHead()
-
seekToStreamTime()
-
seekToChapterWithAnimation()
-
startSeekCsiAction()
-
getStreamTimeOffset()
-
setIsExternalPlaylist()
-
downloadVideo()
-
refreshAllVideos()
-
deleteVideos()
-
deleteAllVideos()
-
isOrchestrationLeader()
-
getAppState()
-
addInfoCardXml()
-
updateLastActiveTime()
-
setBlackout()
-
setAccountLinkState()
-
updateAccountLinkingConfig()
-
setUserEngagement()
-
updateSubtitlesUserSettings()
-
setFauxFullscreen()
-
setUseFastSizingOnWatch()
-
getPresentingPlayerType()
-
canPlayType()
-
updatePlaylist()
-
updateVideoData()
-
updateEnvironmentData()
-
sendVideoStatsEngageEvent()
-
setCardsVisible()
-
productsInVideoVisibilityUpdated()
-
setSafetyMode()
-
isAtLiveHead()
-
getVideoAspectRatio()
-
getPreferredQuality()
-
setPlaybackQualityRange()
-
onAdUxClicked()
-
getFeedbackProductData()
-
getStoryboardFrame()
-
getStoryboardFrameIndex()
-
getStoryboardLevel()
-
getNumberOfStoryboardLevels()
-
getCaptionWindowContainerId()
-
getAvailableQualityLabels()
-
setAutonav()
-
isNotServable()
-
channelSubscribed()
-
channelUnsubscribed()
-
isPictureInPictureAllowed()
-
togglePictureInPicture()
-
supportsGaplessAudio()
-
enqueueVideoByPlayerVars()
-
clearQueue()
-
isFastLoad()
-
getPlayerResponse()
-
getAudioTrack()
-
setAudioTrack()
-
getAvailableAudioTracks()
-
getMaxPlaybackQuality()
-
getUserPlaybackQualityPreference()
-
getSubtitlesUserSettings()
-
resetSubtitlesUserSettings()
-
setMinimized()
-
confirmYpcRental()
-
setInlinePreview()
-
toggleSubtitlesOn()
-
handleExternalCall()
-
isExternalMethodAvailable()
-
getStatsForNerds()
-
setScreenLayer()
-
getCurrentPlaylistSequence()
-
getPlaylistSequenceForTime()
-
shouldSendVisibilityState()
-
updateFullerscreenEduButtonVisibility()
-
updateFullerscreenEduButtonSubtleModeState()
-
setGlobalCrop()
-
getVisibilityState()
-
isMutedByMutedAutoplay()
-
setInternalSize()
-
seekBy()
-
mutedAutoplay()
-
showControls()
-
hideControls()
-
cancelPlayback()
-
getProgressState()
-
isInline()
-
setInline()
-
getStoryboardFormat()
-
getVideoContentRect()
-
toggleFullscreen()
-
isFullscreen()
-
getVideoStats()
-
getPlayerSize()
-
toggleSubtitles()
-
setCenterCrop()
-
handleGlobalKeyDown()
-
handleGlobalKeyUp()
-
setSizeStyle()
-
wakeUpControls()
How to stop autoplay next video in youtube? (turn off "auto play")
I was try but not work