Skip to content

Instantly share code, notes, and snippets.

@JoonHoSon
Forked from PechenkiUA/iframe.js
Created October 29, 2024 06:55
Show Gist options
  • Select an option

  • Save JoonHoSon/03f8106a02c7d6b47bb1e70461755acc to your computer and use it in GitHub Desktop.

Select an option

Save JoonHoSon/03f8106a02c7d6b47bb1e70461755acc 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