需要使用查询字符串在 JWPlayer 中获取多个播放列表文件的帮助

发布于 2024-12-09 12:47:54 字数 562 浏览 7 评论 0原文

我有一个视频页面和许多播放列表文件。

问题是我不知道如何使 JWplayer 的“文件”参数成为变量,以便它可以读取我的任何播放列表文件。我已经研究过并有关于 flashvars 和查询字符串的这个和那个,但我对此很陌生,不明白它是如何完成的。

查询字符串是否是正确的方法,或者是否有更好的方法?

<script type="text/javascript">
    jwplayer('container').setup({
        'file': 'playlist/0000001.xml',
        'flashplayer': 'player/player.swf',
        'skin': 'skins/glow.zip',
        'width': '640',
        'height': '600',
        'controlbar': 'bottom',
        'playlist.position': 'bottom',
        'playlist.size': '240'
    });
</script>

I have a single video page and many playlist files.

The problem is I don't know how to make the JWplayer's 'file' parameter a variable so it can read any of my playlist files. I have researched and have this and that bout flashvars and query strings, but I'm new to this and don't understand how it is done.

Are query strings even the right way to go, or is there a better way?

<script type="text/javascript">
    jwplayer('container').setup({
        'file': 'playlist/0000001.xml',
        'flashplayer': 'player/player.swf',
        'skin': 'skins/glow.zip',
        'width': '640',
        'height': '600',
        'controlbar': 'bottom',
        'playlist.position': 'bottom',
        'playlist.size': '240'
    });
</script>

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

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

发布评论

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

评论(1

帅气尐潴 2024-12-16 12:47:54

我找到了使用查询字符串的解决方案。

将此代码放在我的标题中...

<%
    Dim strPar
    If Request.QueryString("playlist") = "" Then
        strPar = "0000009.xml"
    Else
        strPar = Request.QueryString("playlist")
    End If
%>

然后我只是将这一行用于 JWPplayer 播放列表...

'file': 'playlist/<%=strPar%>',

我现在可以使用这些链接...

index.asp?playlist=0000001.xmlindex.asp

?playlist=0000002.xmlindex.asp

?playlist=0000003.xml等...

I found a solution using query string.

Placed this code in my headers...

<%
    Dim strPar
    If Request.QueryString("playlist") = "" Then
        strPar = "0000009.xml"
    Else
        strPar = Request.QueryString("playlist")
    End If
%>

Then I just used this line for the JWPplayer playlist...

'file': 'playlist/<%=strPar%>',

I can now use these links...

index.asp?playlist=0000001.xml

index.asp?playlist=0000002.xml

index.asp?playlist=0000003.xml etc...

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