简体   繁体   English

使视频源成为Javascript中的变量

[英]Making a Video Source a Variable in Javascript

I have a video that I want to create as a variable so I can insert it into the HTML string. 我有一个要创建为变量的视频,因此可以将其插入HTML字符串中。 This is what I have right now. 这就是我现在所拥有的。

Variable: 变量:

var vids = 'big_buck_bunny.mp4';

HTML string: HTML字符串:

'<source type="video/mp4" src="videos/' + vids + '" />' 

When I refresh the browser it does not find the video 当我刷新浏览器时,找不到视频

您在src="videos/的末尾缺少" ,或者至少在某处的引号不匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM