gpt4 book ai didi

javascript - 从嵌入按钮复制的 iframe 中未显示正确的 url

转载 作者:数据小太阳 更新时间:2023-10-29 04:39:35 26 4
gpt4 key购买 nike

我在一个网站上工作,从嵌入按钮复制后没有显示正确的 url。

单击嵌入按钮(如下图所示)后,我在 iframe 中得到以下代码,其中 src 的值不正确。它应该是一个正确的视频 url。

<iframe src="//content.jwplatform.com/players/dalet_clips/35472P.mp4-88sIiZig.html" width="640" height="360" frameborder="0" scrolling="auto"></iframe>

enter image description here


我在 jwplatform.js 中使用的代码片段是:

"sharing": {
"code": "%3Ciframe%20src%3D%22http%3A//content.jwplatform.com/players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E",
"link": "http://content.jwplatform.com/previews/MEDIAID-6gKQPrHW"
},

问题陈述:

在 iframe src 中,我得到以下代码 //content.jwplatform.com/players/dalet_clips/35472P.mp4-88sIiZig.html 这是不正确的。它应该是视频的正确网址。我想知道我需要做哪些更改才能在 iframe src 中获得完整的video url

最佳答案

尝试更改 code sharing中的属性(property)jwplatform.js 中的选项至 encodeURIComponent无论你想要什么都是准确的iframe内容

示例:现在你有了 code作为%3Ciframe%20src%3D%22http%3A//content.jwplatform.com/players/MEDIAID-6gKQPrHW.html%22%20width%3D%22480%22%20height%3D%22270%22%20frameborder%3D%220%22%20scrolling%3D%22auto%22%3E%3C/iframe%3E

现在尝试用 decodeURIComponent(code) 解码它计算结果为:

<iframe src="http://content.jwplatform.com/players/MEDIAID-6gKQPrHW.html" width="480" height="270" frameborder="0" scrolling="auto"></iframe>

您应该尝试同时更改 codelink到您的实际视频链接和代码。只需使用 encodeURIComponent 将您想要的任何内容编码为代码即可或使用 decodeURIComponent 测试当前版本, 同时在 link 中保留正确的链接属性(property)。

关于javascript - 从嵌入按钮复制的 iframe 中未显示正确的 url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54611927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com