ai didi

javascript - Internet Explorer <视频> 更改来源

转载 作者:行者123 更新时间:2023-12-03 10:12:45 24 4
gpt4 key购买 nike

我正在使用 javascript 设置标签的来源:

$("#video-player").attr("src", '/DownloadCenter/GetFile?path=' + file.Path);

第一次设置源没有问题,但如果我使用相同的代码片段会导致以下错误:

invalid source

有人有更改视频标签来源的经验吗?

最佳答案

您能否验证一下您设置的路径是否正确?例如'/DownloadCenter/GetFile?path=' + file.Path 肯定指向有效的视频文件`?

你可以尝试完全不使用 jQuery:

document.getElementById("video-player").src = "pathToVideoFile.mp4";

编辑!

尝试通过将以下内容添加到 .htaccess 文件来设置视频服务器的 MIME 类型:

AddType video/mp4 .mp4 .m4v
AddType video/webm .webm

关于javascript - Internet Explorer <视频> 更改来源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30032751/

24 4 0
文章推荐: javascript - 搜索数组并制作找到和未找到单词的编号列表,Javascript
文章推荐: scala - 为什么 "type class"称为 "type class"?
文章推荐: forms - 在 iframe 中提交表单并重定向整个页面
文章推荐: javascript - Selenium IDE - AssertEval 2 个数字,只要它们在 5 以内
行者123
个人简介

我是一名优秀的程序员,十分优秀!

滴滴打车优惠券免费领取
滴滴打车优惠券
全站热门文章
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com