Files
ClassContent/历届学生/逯帅帅/项目开发/上课项目/快手/info.html
2024-09-27 02:06:13 +08:00

48 lines
1010 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<video src="" controls></video>
</body>
<script src="api.js"></script>
<script>
function GetInfo() {
api.get({
url: "/play",
data: {
principalId: getUrlSearch("uid"),
photoId: getUrlSearch("vid")
},
success: function (res) {
document.querySelector("video").src = res.playUrl
document.querySelector("video").poster = res.poster
},
error: function (err) {
console.log(err)
}
});
}
GetInfo()
function getUrlSearch(name) {
if (!name) return null;
var after = window.location.search;
after = after.substr(1) || window.location.hash.split('?')[1];
if (!after) return null;
if (after.indexOf(name) === -1) return null;
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
var r = decodeURI(after).match(reg);
if (!r) return null;
return r[2];
}
</script>
</html>