i添加
"sources": <|php echo $file?>结果
"sources":[{"type": "video/mp4", "label": "HD", "file": "https://video-12345.mp4"}] }],我想添加下载按钮
function() {
window.location.href = " <|php echo $file?>";结果
function() {
window.location.href = [{"type": "video/mp4", "label": "HD", "file": "https://video-12345.mp4"}] }],所以我只想要视频链接?像这样的结果..。
function() {
window.location.href = "https://video-12345.mp4";,所以我想通过点击下载
发布于 2018-01-26 21:18:54
如果< array回送$file?>生成一个值数组,那么.
var data = [{"type": "video/mp4", "label": "HD", "file": "https://video-12345.mp4"}]; // output of <|php echo $file?>
function myFunction() {
window.location.href = data[0]['file']; // first item in data array, file property value
}https://stackoverflow.com/questions/48469364
复制相似问题