Web
HTML5
Video and Subtitle
<video width="720" controls crossorigin="use-credentials">
<source src="https://t4f-office-common.oss-cn-chengdu.aliyuncs.com/talks/hr/AI%20Applications%20in%20People%20Management/Module%201/1_1%20Course%20Introduction.mp4" type="video/mp4">
<track src="https://t4f-office-common.oss-cn-chengdu.aliyuncs.com/talks/hr/AI%20Applications%20in%20People%20Management/Module%201/1_1%20Course%20Introduction.chs.vtt" kind="subtitles" srclang="zh" label="简体中文" type="text/vtt" default>
<track src="https://t4f-office-common.oss-cn-chengdu.aliyuncs.com/talks/hr/AI%20Applications%20in%20People%20Management/Module%201/1_1%20Course%20Introduction.vtt" kind="subtitles" srclang="en" label="English" type="text/vtt">
Your browser does not support the video tag.
</video>
在本地目录开启 HTTP 服务器
最快速的办法:使用 Python 内置 HTTP 服务器
这是目前 macOS 推荐使用的命令,因为较新的 macOS 版本默认使用 Python 3。
python3 -m http.server 8000
python3: 调用 Python 3 解释器。-m http.server: 运行http.server模块,这是一个简单的 HTTP 服务器。8000(可选): 指定端口号,你可以改为其他数字,如 8080。如果不指定,默认为 8000。
启动后,在浏览器中访问:http://localhost:8000 或 http://127.0.0.1:8000。
使用 Node.js 的 http-server
-
一次性安装 (如果未安装):
npm install -g http-server(你需要先安装 Node.js 和 npm)
-
启动服务器: 在目标目录下执行:
http-server服务器会启动,并显示可用的本地 IP 地址和端口(通常是
http://127.0.0.1:8080)。