简体   繁体   English

html5视频元素-如何获得其名称

[英]html5 video element - how can I get its name

I am writing an html5 video play-list based on video.js and need to display the name of the current video. 我正在基于video.js编写html5视频播放列表,并且需要显示当前视频的名称。 While I can easily get some meta-data such as the clip's duration using the js API, the name is no where to be found. 虽然我可以使用js API轻松获取一些元数据(例如剪辑的持续时间),但是在哪里都找不到该名称。 Any suggestion? 有什么建议吗?

If with the name you mean the file name (only name you can extract from the file itself), you can verify the src attribute of the tag. 如果使用名称来表示文件名(可以从文件本身提取的唯一名称),则可以验证标记的src属性。 Remember to remove the URL part and keep only what's after the last '/'. 切记删除URL部分并仅保留最后一个'/'之后的内容。

Otherwise you must send the name to the client side (maybe using microdata ?). 否则,您必须将名称发送给客户端(也许使用微数据 ?)。

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

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