开发者

Javascript variable as property setting for jwplayer

开发者 https://www.devze.com 2023-03-06 17:00 出处:网络
HELP!! i need to use a variable for the property \"file\" but cant find any documentation on the proper syntax.

HELP!! i need to use a variable for the property "file" but cant find any documentation on the proper syntax.

if i have:

var video="**URL TO MY VIDEO**";

then i need something like this:

jwplayer("movieContainer").setup({
autostart: true,
flashplayer: "jwplayer/player.swf开发者_开发百科",
skin: "jwplayer/lulu.zip",
height: 270,
width: 480,
file: **video** *<<<< I NEED VAR VIDEO TO PRINT HERE*
});

please help!! THANK YOU SO MUCH!


It's actually very simple -- just put the variable where you'd put the string.

jwplayer("movieContainer").setup({
    autostart: true,
    flashplayer: "jwplayer/player.swf",
    skin: "jwplayer/lulu.zip",
    height: 270,
    width: 480,
    file: video
});


Use this code

jwplayer("movieContainer").setup({
    autostart: true,
    flashplayer: "jwplayer/player.swf",
    skin: "jwplayer/lulu.zip",
    height: 270,
    width: 480,
    file: video,
});
0

精彩评论

暂无评论...
验证码 换一张
取 消