V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
flankerfc
V2EX  ›  问与答

有用过网易云音乐 iframe 播放器的同学吗?今天发现这个 iframe 好像是挂了

  •  1
     
  •   flankerfc · Apr 9, 2025 · 1660 views
    This topic created in 386 days ago, the information mentioned may be changed or developed.

    网易云音乐大多数歌曲,都有一个插件生成,比如:

    https://music.163.com/#/outchain/2/28387594/

    这里通过了一个 iframe 代码,只需要把这个 iframe 加入到你的网站页面就可以使用。虽然不是很完美,但是勉强可以使用。

    从今天早上发现,不确定是不是网易云音乐修改了播放器的代码,现在开始报错了,无法播放了。

    从浏览器 console log 来看,iframe 中的代码,试图在访问父网页的 window 对象:

    Uncaught SecurityError: Failed to read a named property 'IgnoreKickout' from 'Window': Blocked a frame with origin "https://music.163.com" from accessing a cross-origin frame.


    请教大家,有什么好的解决方法吗?

    2 replies    2025-04-10 18:56:37 +08:00
    lingxiaoli
        1
    lingxiaoli  
       Apr 9, 2025
    qq 音乐好像也有类似的 你试试?
    crazyorr
        2
    crazyorr  
       Apr 10, 2025
    还有:
    Uncaught (in promise) SecurityError: Failed to read a named property 'device__browser_update' from 'Window': Blocked a frame with origin "https://music.163.com" from accessing a cross-origin frame.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2766 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 14:20 · PVG 22:20 · LAX 07:20 · JFK 10:20
    ♥ Do have faith in what you're doing.