Skip to content

Instantly share code, notes, and snippets.

@PechenkiUA
Created December 29, 2022 07:18
Show Gist options
  • Save PechenkiUA/03abee71896d85a8320f2d1359c1347c to your computer and use it in GitHub Desktop.
Save PechenkiUA/03abee71896d85a8320f2d1359c1347c to your computer and use it in GitHub Desktop.
Youtube iframe contentWindow.postMessage command
document.querySelector('iframe').contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
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
getPlayerMode
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
getSize
logImaAdEvent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment