-
Notifications
You must be signed in to change notification settings - Fork 0
/
detail.html
executable file
·96 lines (96 loc) · 2.45 KB
/
detail.html
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
90
91
92
93
94
95
96
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>VideoRecomender</title>
<style type="text/css">
body{
background: #339933;
font-family:'微软雅黑,sans-serif';
}
#main{
width:900px;
margin-left:auto;
margin-right:auto;
margin-top:100px;
}
.player{
width:500px;
float:left;
}
#tagList{
margin-top:100px;
width:380px;
float:left;
}
.item{
padding-left:5px;
padding-right:5px;
line-height:30px;
background:rgb(30,30,30);
font-size:20px;
color:white;
text-align:center;
float:left;
margin-left:20px;
margin-top:20px;
}
</style>
<script src="jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function cookie(name){
var cookieArray=document.cookie.split("; ");
var cookie=new Object();
for (var i=0;i<cookieArray.length;i++){
var arr=cookieArray[i].split("=");
if(arr[0]==name)return unescape(arr[1]);
}
return "";
};
$(function(){
var vid = cookie('vid');
$.get('https://openapi.youku.com/v2/videos/show.json',{
client_id:'9c528d4d804d3150',
video_id:vid
},function(data){
var videoData = JSON.parse(data);
var tags = videoData.category+','+videoData.tags;
var videoTags = tags.split(',');
videoTags.forEach(function(tag){
var html = '<div class="item">'+tag+'</div>';
$('#tagList').append(html);
});
if(cookie('uid')!=''){
var vid = cookie('vid');
var uid = cookie('uid');
$.post('/addhistory',{
uid: uid,
vid: vid,
tags: tags
},function(data){
console.log(data);
});
}
});
});
</script>
</head>
<body>
<div id="main">
<div class="player">
<div id="youkuplayer" style="width:480px;height:400px">
</div>
<script type="text/javascript" src="http://player.youku.com/jsapi">
var vid = cookie('vid');
player = new YKU.Player('youkuplayer',{
styleid: '3',
client_id: '9c528d4d804d3150',
vid: vid
});
</script>
</div>
<div id="tagList">
</div>
</div>
</body>
</html>