forked from deeptexas-ai/online-holdem-platform
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvideo.html
More file actions
89 lines (86 loc) · 2.69 KB
/
video.html
File metadata and controls
89 lines (86 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>视频详情</title>
<style>
video {
max-width: 100% !important;
}
</style>
<script>
const TYPE_MAP = {
1: '人物专访',
2: '赛事集锦',
3: '精彩牌局',
4: '造梦工厂'
}
window.onload = function () {
loadNewsById(GetQueryString('id'))
}
function GetQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
var r = window.location.search.substr(1).match(reg) //获取url中"?"符后的字符串并正则匹配
var context = ''
if (r != null) context = decodeURIComponent(r[2])
reg = null
r = null
return context == null || context == '' || context == 'undefined' ? '' : context
}
function loadNewsById(id) {
if (!id) return
let xhr = new XMLHttpRequest()
if (window.location.href.indexOf('10.10.10.') != -1) {
xhr.open('get', '/stage-api/match/matchVideo/' + id)
// xhr.open('get', 'http://10.10.10.25:5555/dev-api/match/matchNews/' + id)
} else {
xhr.open('get', '/prod-api/match/matchVideo/' + id)
}
xhr.send()
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
let resp = JSON.parse(xhr.responseText)
if (resp && resp.data) {
document.getElementById('newsTitle').innerHTML = TYPE_MAP[resp.data.videoType] + ' | ' + resp.data.title
document.getElementById('newsTime').innerHTML = resp.data.createTime
document.getElementById('newsContent').innerHTML = resp.data.detail
document.title = TYPE_MAP[resp.data.videoType] + ' | ' + resp.data.title
}
}
}
}
</script>
<style>
body {
background-color: #ffffff;
}
.news {
text-align: center;
width: 700px;
max-width: 100%;
margin: 0 auto;
}
.content {
margin: 10px;
text-align: left;
}
.content img {
max-width: 100%;
}
#newsTitle {
text-align: left;
}
</style>
</head>
<body>
<div class="news">
<header>
<h3 id="newsTitle"></h3>
<div class="create-time" id="newsTime"></div>
</header>
<div class="content" id="newsContent"></div>
</div>
</body>
</html>