单击父级中的某些内容时,如何将 URL 地址从父级传递到 iframe?

发布于 2024-08-15 10:29:05 字数 634 浏览 3 评论 0原文

我有一个 html 页面,其中有一个 iframe。 iframe 只做一件事情来保存长尾视频播放器。这是长尾视频播放器(iframe)的代码...

<script type='text/javascript'>
  var so = new SWFObject('player.swf','mpl','725','415','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','VIDEOFILENAME.FLV');
  so.addVariable('displayclick','fullscreen');
  so.addVariable('icons','false');
  so.write('mediaspace');
</script>

我想要做的是将文件名从父级(文件位于我的服务器上)传递到上面的代码并替换“videofilename.flv”然后播放该文件。单击图像时应发送文件名。我该怎么做?基本上我将有 20 个图像,单击这些图像时,每个图像都会在 iframe 中单独播放不同的视频。

I have an html page with an iframe in it. The iframe only does 1 thing which holds the longtail video player. Here is the code for the longtail video player (the iframe)...

<script type='text/javascript'>
  var so = new SWFObject('player.swf','mpl','725','415','9');
  so.addParam('allowfullscreen','true');
  so.addParam('allowscriptaccess','always');
  so.addParam('wmode','opaque');
  so.addVariable('file','VIDEOFILENAME.FLV');
  so.addVariable('displayclick','fullscreen');
  so.addVariable('icons','false');
  so.write('mediaspace');
</script>

What i'm looking to do is pass a file name from the parent (the file is on my server) to the above code and replace "videofilename.flv" and then play that file. This sending of the file name should occur when an image is clicked. How do I do this? Basically I'll have 20 images which when clicked will each individually play a different video in the iframe.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初见你 2024-08-22 10:29:05

我希望有帮助吗?页面上的 iframe 可以通过数组访问。

I hope this helps? The iframes on a page are accessible via an array.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文