Skip to content

Commit 389e3d1

Browse files
author
why2fly
committed
站点有效性更新
1 parent 1908b5c commit 389e3d1

File tree

5 files changed

+117
-168
lines changed

5 files changed

+117
-168
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ h-player-web 是个人最近学习 vue.js 而开发的一个练手项目,没
1616

1717
## nodejs版食用方法
1818

19-
1.npm install
20-
2.node server.js
19+
1. npm install
20+
21+
2. node server.js
2122

2223

2324

index.html

Lines changed: 58 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,71 @@
44
<script src="./public/ext/jquery.min.js"></script>
55
<script type="text/javascript" src="./public/ext/bootstrap.min.js"></script>
66
<script type="text/javascript" src="./public/ext/tongji.baidu.js"></script>
7+
<style>
8+
button {
9+
position: relative;
10+
display: inline-block;
11+
overflow: hidden;
12+
border: 1px solid #999;
13+
}
14+
</style>
715

816
<div id="app">
9-
10-
11-
12-
<div>站点:
13-
<button v-for="(host,index) in hostlist" v-on:click="changehost(host.id)">{{ host.id }} {{ host.name }}</button>
14-
</div>
15-
16-
<div>分类:
17-
<button v-for="(item,index) in getclass_rsp.class" v-on:click="getclasspage(item.cid)">{{ item.cid }}{{ item.title }}</button>
18-
</div>
19-
2017
<div>
21-
<input v-model="querywd" placeholder="请输入关键字" size="50" type='text' />
22-
<button v-on:click="querypage">查询"{{ querywd }}"</button>
18+
<!--style="position:fixed;width:100%;height:700px"style="background:#EEEEEE;"-->
19+
20+
<video id="video" controls style="width:100%;"></video>
21+
<div>
22+
23+
<br />
24+
<div>站点:
25+
<button v-for="(host,index) in hostlist" v-on:click="changehost(host.id)" class="btn">{{ host.id }}
26+
{{ host.name }}</button>
27+
</div><br />
28+
29+
<div>分类:
30+
<button v-for="(item,index) in getclass_rsp.class" v-on:click="getclasspage(item.cid)"
31+
class="btn">{{ item.cid }}
32+
{{ item.title }}</button>
33+
</div><br />
34+
35+
<div>
36+
<input v-model="querywd" placeholder="请输入关键字" size="50" type='text' />
37+
<button v-on:click="querypage" class="btn">查询"{{ querywd }}"</button>
38+
</div><br />
39+
40+
<div>
41+
<!-- disabled来禁用按钮,v-if不会渲染按钮 -->
42+
<button :disabled="getlist_rsp.page===1" v-on:click="getnextpage(1)" class="btn">首页</button>
43+
<button :disabled="getlist_rsp.page===1" v-on:click="getnextpage(getlist_rsp.page-1)"
44+
class="btn">上一页</button>
45+
<span>{{ getlist_rsp.page }}/{{ getlist_rsp.pagecount }}</span>
46+
<button :disabled="getlist_rsp.page===getlist_rsp.pagecount"
47+
v-on:click="getnextpage(getlist_rsp.page+1)" class="btn">下一页</button>
48+
<button :disabled="getlist_rsp.page===getlist_rsp.pagecount"
49+
v-on:click="getnextpage(getlist_rsp.pagecount)" class="btn">最后一页</button>
50+
</div>
51+
<span>当前站:{{ hostid }} 分类:{{ classid }} 关键字:{{ querywd }} 页数:{{ pg }} </span><br />
52+
<span>提示:{{ tips }} </span><br /><br />
53+
54+
<button v-on:click="showmylike()" class="btn">查看本地收藏</button>
55+
56+
</div>
57+
2358
</div>
24-
25-
<span>当前站:{{ hostid }} /分类:{{ classid }} /关键字:{{ querywd }} /页数:{{ pg }} </span>
26-
<span>提示:{{ tips }} </span>
27-
<button v-on:click="showmylike()">查看本地收藏</button>
2859

2960
<div>
30-
<!-- disabled来禁用按钮,v-if不会渲染按钮 -->
31-
<button :disabled="getlist_rsp.page===1" v-on:click="getnextpage(1)">首页</button>
32-
<button :disabled="getlist_rsp.page===1" v-on:click="getnextpage(getlist_rsp.page-1)">上一页</button>
33-
<span>{{ getlist_rsp.page }}/{{ getlist_rsp.pagecount }}</span>
34-
<button :disabled="getlist_rsp.page===getlist_rsp.pagecount"
35-
v-on:click="getnextpage(getlist_rsp.page+1)">下一页</button>
36-
<button :disabled="getlist_rsp.page===getlist_rsp.pagecount"
37-
v-on:click="getnextpage(getlist_rsp.pagecount)">最后一页</button>
38-
</div>
39-
40-
<div><!--style="padding-top:700px;width:100%;"-->
41-
<div v-for="(item,index) in getlist_rsp.data" class="unit">
42-
<div style="float:left;padding:10px;max-width: 460px;">
43-
<img v-on:click="playvideo(item.vpath)" v-bind:src="item.vod_pic" style="max-width:100%;">
44-
<p>{{ item.vod_title }}</p>
45-
<p>{{ item.category }} {{ item.vod_addtime }}<button v-on:click="likeit(item)">收藏</button><button v-on:click="unlikeit(item)">取消收藏</button></p>
61+
<!--style="padding-top:700px;width:100%;"-->
62+
<div v-for="(item,index) in getlist_rsp.data" class="unit">
63+
<div style="float:left;padding:10px;max-width: 460px;">
64+
<img v-on:click="playvideo(item.vpath)" v-bind:src="item.vod_pic" style="max-width:100%;">
65+
<p>{{ item.vod_title }}</p>
66+
<p>{{ item.category }} {{ item.vod_addtime }}
67+
<button v-on:click="likeit(item)" class="btn">收藏</button><button v-on:click="unlikeit(item)"
68+
class="btn">取消收藏</button></p>
69+
</div>
4670
</div>
47-
</div>
48-
</div>
49-
50-
71+
</div>
5172
</div>
5273

5374
<script src="./public/index.js"></script>

public/index.js

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
[
33
{
44
"id": 1,
5-
"name": "色色资源站"
5+
"name": "富二代资源站"
66
},
77
{
88
"id": 2,
9-
"name": "玖玖资源站"
9+
"name": "玖玖资源站(失效)"
1010
},
1111
{
1212
"id": 3,
13-
"name": "撸死你资源站"
13+
"name": "撸死你资源站(失效)"
1414
},
1515
{
1616
"id": 4,
17-
"name": "富二代资源站"
17+
"name": "色色资源站(失效)"
1818
},
1919
{
2020
"id": 5,
21-
"name": "字幕网资源站"
21+
"name": "字幕网资源站(失效)"
2222
},
2323
{
2424
"id": 6,
25-
"name": "久草资源站"
25+
"name": "Yellow字幕网(bug)"
2626
},
2727
{
2828
"id": 7,
29-
"name": "女优资源站"
29+
"name": "女优资源站(失效)"
3030
},
3131
{
3232
"id": 8,
3333
"name": "利来资源站"
3434
},
3535
{
3636
"id": 9,
37-
"name": "博天堂资源站"
37+
"name": "博天堂资源站(失效)"
3838
}
3939
]
4040

@@ -65,6 +65,7 @@ var vm = new Vue({
6565
created: function (){
6666
this.getclass();
6767
this.getlist();
68+
this.postuserinfo();
6869
},
6970
methods: {
7071
//向nodejs后端发送get请求,由后端调用外部引擎,解决跨域问题;
@@ -85,7 +86,7 @@ var vm = new Vue({
8586
url = fix[1];
8687
}
8788
console.log("urlfix:" + url);
88-
window.open('http://www.guangguluntan.com:81/webplayer/player.html?url=' + url);
89+
PlayVideo(url);
8990
},
9091
// 翻页
9192
getnextpage:function(page){
@@ -153,5 +154,31 @@ var vm = new Vue({
153154
this.getlist_rsp.data = this.mylike;
154155
this.tips = "加载本地收藏完毕,have fun !";
155156
},
157+
// 获取用户浏览器信息
158+
postuserinfo:async function(){
159+
//this.tips = "正在努力加载,请等待...";
160+
//this.getlist_rsp = await this.search('/getlist?id=' + this.hostid + '&pg=' + this.pg + "&t="+this.classid+"&wd="+this.querywd);
161+
//this.tips = "搜索完毕,have fun !";
162+
},
156163
}
157164
});
165+
166+
167+
168+
function PlayVideo(url){
169+
var Hls = window.Hls
170+
if (Hls.isSupported()) {
171+
var hls = new Hls()
172+
hls.loadSource(url)
173+
hls.attachMedia(video)
174+
hls.on(Hls.Events.MANIFEST_PARSED, function () {
175+
video.play()
176+
})
177+
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
178+
video.src = url
179+
video.addEventListener('canplay', function () {
180+
video.play()
181+
})
182+
}
183+
}
184+

public/player.js

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)