How to play only the audio of a Youtube video using HTML 5?

前端 未结 9 630
花落未央
花落未央 2020-12-02 11:17

Is it possible to play only the audio from a YouTube video using HTML 5 and Javascript?

9条回答
  •  天涯浪人
    2020-12-02 11:51

    Embed the video player and use CSS to hide the video. If you do it properly you may even be able to hide only the video and not the controls below it.

    However, I'd recommend against it, because it will be a violation of YouTube TOS. Use your own server instead if you really want to play only audio.

提交回复
热议问题