V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
flankerfc
V2EX  ›  问与答

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

  •  1
     
  •   flankerfc · 16 天前 · 739 次点击

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

    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 条回复    2025-04-10 18:56:37 +08:00
    lingxiaoli
        1
    lingxiaoli  
       16 天前
    qq 音乐好像也有类似的 你试试?
    crazyorr
        2
    crazyorr  
       15 天前
    还有:
    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.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2768 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 02:34 · PVG 10:34 · LAX 19:34 · JFK 22:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.