");
53 | $("#page_result").append(so_info);
54 |
55 | var items = $("
");
56 |
57 | //...
58 |
59 | for (key in video_list) {
60 |
61 | var item = $("
");
62 |
63 | item.find(".coverimg").attr({
64 | "src": video_list[key].videoCoverPath,
65 | });
66 |
67 | var video_info = $("
").appendTo(tags);
75 |
76 | video_info.appendTo(item);
77 | tags.appendTo(item);
78 |
79 | item.appendTo(items);
80 | }
81 |
82 | $("#page_result").append(items)
83 | }
84 |
85 |
--------------------------------------------------------------------------------
/src/main/webapp/js/logout.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/14.
3 | */
4 |
5 | //登出,下线
6 | function logout_submit() {
7 |
8 | if (userid_my) {
9 |
10 | if ("undefined" != typeof websocket) {//直播用户下线
11 | websocket.send(JSON.stringify({
12 | "group": "danmu",
13 | "state": 2,//下线状态码
14 | "logout_id": userid_my
15 | }));//切换为用户登录状态
16 |
17 | //主播下线
18 | if ("undefined" != typeof websocket && isliver()) {
19 | close_live();
20 | }
21 |
22 | }
23 |
24 |
25 | $.ajax({
26 | type: "POST",
27 | url: server_path + "/ajax/logout_logoutJsonAction",
28 | dataType: "json",
29 | data: {
30 | logout_id: userid_my
31 | },
32 | success: function (data) {
33 | if (data.success) {
34 |
35 | var strs = window.location.pathname.split("/");
36 | var parent_path = strs[strs.length - 2];
37 |
38 | if (parent_path == "vip") {//如果在vip下则 重新加载
39 | window.location.reload(true);//刷新页面
40 | }
41 | else {
42 |
43 | userid_my = "";
44 | islogined = false;
45 | userPicPath = "";
46 | username_my = "";
47 |
48 | if ("undefined" != typeof isprovider) {
49 | isprovider = false;
50 | }
51 | login_update();
52 |
53 | }
54 |
55 | }
56 | else {
57 | alert("下线失败请重试");
58 | }
59 | },
60 | error: function (jqXHR) {
61 | alert("错误提示: " + jqXHR.status + " " + jqXHR.statusText);
62 | }
63 | });
64 | }
65 | else {
66 | alert("请先登录");
67 | }
68 |
69 |
70 | }
71 |
72 | $(document).ready(function () {
73 | $("#logout").on("click", function () {
74 |
75 | if (confirm("亲,确定要走吗?")) {
76 | logout_submit();
77 | }
78 |
79 | }
80 | );
81 | })
--------------------------------------------------------------------------------
/src/main/webapp/js/modal_login_resign.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/6/27.
3 | */
4 | function login_model_show() {
5 | $(".modal-body").find("input").val("")
6 | $("#login_div").show();
7 | $("#resig_div").hide();
8 | $(".holder").hide();
9 | }
10 | function resign_model_show() {
11 | $(".modal-body").find("input").val("")
12 | $("#resig_div").show();
13 | $("#login_div").hide();
14 | $(".holder").hide();
15 | }
16 | function close_modal() {
17 | $("#myModal_content").css("-webkit-animation", "umod 1s linear");
18 | $("#myModal_content").css("animation-fill-mode", "forwards");
19 | setTimeout(" $('#myModal').modal('hide')", 1000)
20 | }
21 |
22 |
23 | $(document).ready(function () {
24 |
25 |
26 | //用户id(手机号)存在检测
27 | $("#userid_login").blur(function () {
28 | var str_id = $(this).val().trim();
29 | if (str_id != null && str_id.length > 0) {
30 | $.when(isexit_user(str_id)).done(function (is_exit) {
31 | if (is_exit) {
32 | $("#hold1").hide();
33 | } else {
34 | $("#hold1").text("用户不存在");
35 | $("#hold1").show();
36 | }
37 | })
38 |
39 | } else {
40 | $(this).next("span").text("用户不能为空");
41 | $(this).next("span").show();
42 | }
43 | });
44 |
45 |
46 | $("#myModal").on("shown.bs.modal", function () {
47 | $("#myModal_content").css("-webkit-animation", "mod 1s linear");
48 | });
49 |
50 | //登录模态框打开
51 | $("#btn1").click(function () {
52 | $("#myModal").modal("show");
53 | $("#xian").css({left: '2px'});
54 | login_model_show()
55 | });
56 | //注册模态框打开
57 | $("#btn2").click(function () {
58 | $("#myModal").modal("show");
59 | $("#xian").animate({left: '51px'});
60 | resign_model_show()
61 | });
62 |
63 | //滑动小线动画
64 | $("#mydelulablel").click(function () {
65 | $("#xian").animate({left: '2px'});
66 | login_model_show();
67 | });
68 | $("#myzhucelablel").click(function () {
69 | $("#xian").animate({left: '51px'});
70 | resign_model_show();
71 | });
72 |
73 |
74 | $("#username_resig").blur(function () {
75 | var str = this.value;
76 | var par = /^\d+$/;
77 | if (par.test(str)) {
78 | $(this).next("span").text("用户名不能纯数字").show();
79 | } else {
80 | $(this).next("span").hide();
81 | if (str != null && str.length > 0) {
82 | isexit_user_name(str);
83 | }
84 | else {
85 | $(this).next("span").text("用户名不能为空").show();
86 | }
87 |
88 | }
89 | });
90 |
91 | //密码相同检验
92 | $("#password2").blur(function () {
93 | var str = $(this).val().trim();
94 | if(str!=null&&str.length>0){
95 | check_password2();
96 | }else {
97 | $("#password2").next("span").text("请填写密码").show();
98 | }
99 | });
100 |
101 |
102 | function check_password2() {
103 | var password1 = document.getElementById('password1').value;
104 | var password2 = document.getElementById('password2').value;
105 | if (password1 != password2) {
106 | $("#password2").next("span").text("两次密码不同").show();
107 | document.getElementById('password1').value = "";
108 | document.getElementById('password2').value = "";
109 | }
110 | }
111 |
112 | $("#phone_resig").blur(function () {
113 | var str_id = this.value;
114 | var par = /^(((13[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
115 | if (!par.test(str_id)) {
116 | $(this).next("span").text("手机格式错误").show();
117 | } else {//手机号重复性检验
118 | if (str_id != null && str_id.length > 0) {
119 | $.when(isexit_user_id(str_id)).done(function (is_exit) {
120 | if (is_exit) {
121 | $("#hold3").text("手机号已被注册");
122 | $("#hold3").show();
123 | } else {
124 | $("#hold3").hide();
125 | }
126 | })
127 | } else {
128 | $(this).next("span").text("手机号不能为空");
129 | $(this).next("span").show();
130 | }
131 | }
132 |
133 | });
134 |
135 |
136 | $("#email_resig").blur(function () {
137 | var str = this.value;
138 | var reg = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
139 | if (!reg.test(str)) {
140 | $(this).next("span").text("邮箱格式错误").show();
141 | }
142 | });
143 |
144 |
145 | //恢复检验
146 | $("#resig_div,#login_div").find("input").focus(function () {
147 |
148 | if ($(this).attr("name") != "rember") {
149 | $(this).next("span").hide();
150 | }
151 | });
152 |
153 | });
154 |
--------------------------------------------------------------------------------
/src/main/webapp/js/page_.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/25.
3 | */
4 | //动态生成分页插件
5 | function make_page_plugin() {
6 | $("#page_plugin").empty();
7 |
8 | $("
").appendTo("#page_plugin");
9 | for (var i = 1; i <= pageCount; i++) {
10 | $("
").appendTo("#page_plugin");
11 | }
12 | $(".pageNo_li").eq(pageNo - 1).addClass("active");//将该页面的页号标签点亮
13 | $("
").appendTo("#page_plugin");
14 | }
15 |
16 |
17 | $(document).ready(function () {
18 |
19 | $(document).on("click", ".pageNo_li", function () {//跳到指定页
20 | if ($(this).hasClass('active')) {
21 | //...就在当前页
22 | }
23 | else {
24 |
25 | $("#page_plugin li").removeClass("active");
26 | $(this).addClass("active");
27 | var page_No = parseInt($(this).text());//获取点击的页面页号
28 |
29 | page_ajax(page_No);
30 | }
31 |
32 |
33 | });
34 |
35 | $(document).on("click", "#next_passage", function () {//下一页
36 | var now = $(".active");
37 | var act = $(".active").find("a").get(0);
38 | var last_passage = $(".normal").find("a").last().get(0);
39 | if (act == last_passage) {
40 | alert('到头了')
41 | }
42 | else {
43 | now.removeClass("active");
44 | now.next().addClass("active");
45 | var page_No = pageNo + 1;
46 |
47 | page_ajax(page_No);
48 | }
49 | });
50 |
51 |
52 | $(document).on("click", "#prev_passage", function () {//上一页
53 | var now = $(".active");
54 | var act = $(".active").find("a").get(0);
55 | var first_passage = $(".normal").find("a").first().get(0);
56 | if (act == first_passage) {
57 | alert('到头了')
58 | }
59 | else {
60 | now.removeClass("active");
61 | now.prev().addClass("active");
62 | var page_No = pageNo - 1;
63 |
64 | page_ajax(page_No);
65 | }
66 | });
67 | });
68 |
69 |
70 | function without_data() {
71 | $("#page_result").empty();
72 | $("#page_result").append("
");
73 | }
--------------------------------------------------------------------------------
/src/main/webapp/js/register.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/25.
3 | */
4 |
5 | function resign_submit() {
6 |
7 | var is_register = true;
8 | $("#resig_div .holder").each(function () {
9 | if (!$(this).is(":hidden")) {
10 | is_register = false;
11 | }
12 | });
13 |
14 |
15 |
16 | if (is_register) {
17 | $.ajax({
18 | type: "POST",
19 | url: server_path + "/ajax/registerAction",
20 | dataType: "json",
21 | data: $('#resig_form').serializeArray(),// 提交表单
22 | success: function (data) {
23 | if (data.success) {
24 |
25 | alert(data.username + "注册成功!");
26 |
27 | if ($("#myModal").hasClass('in')) {
28 | close_modal();
29 | }//关闭注册模态框
30 |
31 | }
32 | else {
33 | alert(data.username + "注册失败!");
34 | }
35 | },
36 | error: function (jqXHR) {
37 | alert("错误提示: " + jqXHR.status + " " + jqXHR.statusText);
38 | }
39 | });
40 | }
41 | else {
42 | alert("请核对信息再提交")
43 | }
44 |
45 |
46 | }
--------------------------------------------------------------------------------
/src/main/webapp/js/soso.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/25.
3 | */
4 |
5 | //获取搜索分页数据
6 | function page_ajax(page_No) {
7 |
8 | if (param != null&¶m.length>0) {
9 |
10 | $.ajax({
11 | type: "POST",
12 | url: "ajax/pagevideo-soso",
13 | dataType: "json",
14 | data: {
15 | keyword: param,//搜索参数
16 | 'pageModel.pageNo': page_No //页号参数
17 |
18 | },//请求分页数据
19 | success: function (data) {
20 | if (data.success) {
21 |
22 | //获取当前页号和总页数
23 | pageNo = data.pageModel.pageNo;
24 | pageCount = data.pageModel.pageCount;
25 |
26 | make_page_plugin();//生成分页插件
27 |
28 | update_video_ui(data.pageModel.datas, data.pageModel.recordCount)//更新视频ui
29 |
30 | }
31 | else {
32 | without_data();
33 | }
34 | },
35 | error: function (jqXHR) {
36 | alert("错误提示: " + jqXHR.status + " " + jqXHR.statusText);
37 | }
38 | });
39 | }
40 | else {
41 | // window.location = "404.jsp";
42 | without_data();
43 | }
44 | }
45 |
46 |
47 | //更新视频ui
48 | function update_video_ui(video_list, recordCount) {
49 |
50 | $("#page_result").empty();
51 |
52 | var so_info = $("
").addClass("so_info").append("
共" + recordCount + "条数据
");
53 | $("#page_result").append(so_info);
54 |
55 | var items = $("
");
56 |
57 | //...
58 |
59 |
60 |
61 | for (key in video_list) {
62 |
63 | var item = $("
").append("
");
64 |
65 | item.find(".coverimg").attr({
66 | "src": video_list[key].videoCoverPath,
67 | });
68 |
69 | var video_info = $("
").append("
");
70 |
71 |
72 | var tags = $("
")
73 |
74 | $("
"+video_list[key].videoWatchCount+"次").appendTo(tags);
75 | $("
"+video_list[key].videoUploadTime+"").appendTo(tags);
76 | $("
"+video_list[key].up_user.userName+"").appendTo(tags);
77 |
78 | video_info.appendTo(item);
79 | tags.appendTo(item);
80 |
81 | item.appendTo(items);
82 | }
83 |
84 | $("#page_result").append(items)
85 | }
86 |
87 |
88 |
--------------------------------------------------------------------------------
/src/main/webapp/js/util.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/19.
3 | */
4 | function getObjectURL(file){
5 | var url=null;
6 | if(window.createObjectURL!=undefined){ // basic
7 | url=window.createObjectURL(file)
8 | }else if(window.URL!=undefined){ // mozilla(firefox)
9 | url=window.URL.createObjectURL(file)
10 | } else if(window.webkitURL.createObjectURL!=undefined){ // webkit or chrome
11 | url=window.webkitURL.createObjectURL(file)
12 | }else {
13 | url=URL.createObjectURL(file)
14 | }
15 | return url
16 | }
17 |
18 |
19 | //获取url指定参数的值
20 | // function getQueryString(name) {
21 | // var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
22 | // var r = window.location.search.substr(1).match(reg);
23 | // if (r != null) return unescape(r[2]);
24 | // return null;
25 | //
26 | // }
27 |
28 |
29 | function getQueryString (key){
30 | var lot = location.search;
31 | var reg = new RegExp(".*" + key + "\\s*=([^=]*)(?=&|#|).*","g");
32 | return decodeURIComponent(lot.replace(reg, "$1"));
33 | }
--------------------------------------------------------------------------------
/src/main/webapp/not_login.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2 | <%
3 | String requestURI = request.getRequestURI();
4 | String[] urls=requestURI.split("/");
5 | pageContext.setAttribute("prefix", urls[1]);
6 | %>
7 |
8 |
9 |
10 |
未登录
11 |
12 |
13 | <%--请先登录!!!!!!!!--%>
14 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/src/main/webapp/param.json:
--------------------------------------------------------------------------------
1 | {
2 | "douga": ["动画", "-141", "-908"],
3 | "fanju": [
4 | "番剧",
5 | "-141",
6 | "-140"
7 | ],
8 | "music": [
9 | "音乐",
10 | "-141",
11 | "-266"
12 | ],
13 | "dance": [
14 | "舞蹈",
15 | "-141",
16 | "-461"
17 | ],
18 | "game": [
19 | "游戏",
20 | "-141",
21 | "-203"
22 | ],
23 | "technology": [
24 | "科技",
25 | "-141",
26 | "-525"
27 | ],
28 | "life": [
29 | "生活",
30 | "-141",
31 | "-970"
32 | ],
33 | "kichiku": [
34 | "鬼畜",
35 | "-141",
36 | "-332"
37 | ],
38 | "fashion": [
39 | "时尚",
40 | "-141",
41 | "-718"
42 | ],
43 | "ad": [
44 | "广告",
45 | "-141",
46 | "-1228"
47 | ],
48 | "ent": [
49 | "娱乐",
50 | "-141",
51 | "-1032"
52 | ],
53 | "film": [
54 | "影视",
55 | "-141",
56 | "-396"
57 | ]
58 | }
--------------------------------------------------------------------------------
/src/main/webapp/soso.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2 | <%
3 | String path = request.getContextPath();
4 | pageContext.setAttribute("path", path);
5 | %>
6 |
7 |
8 |
9 |
搜索-biubiu
10 | <%@include file="inclued_page/base_js_css.jsp" %>
11 |
12 |
13 |
14 |
15 |
16 | <%@include file="inclued_page/nav.jsp" %>
17 |
89 | <%@include file="inclued_page/model_login.jsp" %>
90 |
91 |
127 |
128 |
129 |
130 |
131 |
--------------------------------------------------------------------------------
/src/main/webapp/video/img/bg_live.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/video/img/bg_live.jpg
--------------------------------------------------------------------------------
/src/main/webapp/video/img/cannotfind.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/video/img/cannotfind.jpg
--------------------------------------------------------------------------------
/src/main/webapp/video/img/colorpicker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/video/img/colorpicker.png
--------------------------------------------------------------------------------
/src/main/webapp/video/img/zhibo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/video/img/zhibo.jpg
--------------------------------------------------------------------------------
/src/main/webapp/video/js/demand_Barrage.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/11/8.
3 | */
4 |
5 | $(document).ready(function () {
6 |
7 | check_video();//检查视频是否可用
8 |
9 | document.getElementById("demand_video").addEventListener("timeupdate", myFunction);//监听播放时间轴改变时间
10 | document.getElementById("demand_video").addEventListener("play", function () {
11 | barrage_array = barrage_array2.concat();
12 | // $(".d_show").empty();
13 |
14 | });//监听播放事件重新充满数组
15 |
16 | $("#sendbtn").click(function () {//弹幕发送按钮
17 | demand_send_Barrage();
18 | });
19 | });
20 |
21 |
22 | function load_barrages() {//根据url获取视频信息及弹幕信息
23 |
24 | if (barrage_array2 == null || barrage_array2.length == 0) {//获取弹幕数组
25 | console.log("该视频还没有弹幕");
26 | }
27 | barrage_array = barrage_array2.concat();//装载到全局变量
28 | update_barrage_list(barrage_array);
29 |
30 | }
31 |
32 |
33 | //检测视频
34 | function check_video() {
35 | // setTimeout(function () {
36 | // if ($("#demand_video")[0].readyState == 0) {
37 | // $("#demand_video")[0].poster = "img/cannotfind.jpg";
38 | // }
39 | // },180)
40 |
41 | // if (getQueryString("video_id") == "av62813213"||true) {
42 | // $("#demand_video").attr("src", "http://www.bilibilijj.com/Files/DownLoad/12322682.mp4/www.bilibilijj.com.mp4?mp3=true");
43 | // $("#demand_video")[0].load;
44 | // }
45 |
46 | }
47 |
48 |
49 | function update_barrage_list(barrage_list) {//更新弹幕列表
50 | $("#barrage_table").empty();
51 | for (key in barrage_list) {
52 | var barrage_ = barrage_list[key];
53 | var barrage_item = $("
" + getnum(parseFloat(barrage_.videoTimePrint)) + " | " + barrage_.barrageContent + " | " + getDate(barrage_.barrageCreateTime + "") + " |
")
54 | $("#barrage_table").append(barrage_item);
55 | }
56 | $("#barrage_number_").text(barrage_list.length + "");//更新总条数
57 | }
--------------------------------------------------------------------------------
/src/main/webapp/video/js/format_date.js:
--------------------------------------------------------------------------------
1 | function getnum(time)//视频时间格式转换
2 | {
3 |
4 | var minute = Math.floor(time / 60);
5 | if (minute < 10) {
6 | minute = "0" + minute;
7 | }
8 | var second = parseInt(time) - minute * 60;
9 | if (second < 10) {
10 | second = "0" + second;
11 | }
12 |
13 |
14 | return minute + ":" + second;
15 | }
16 |
17 |
18 | function Format(now, mask) {
19 | var d = now;
20 | var zeroize = function (value, length) {
21 | if (!length) length = 2;
22 | value = String(value);
23 | for (var i = 0, zeros = ''; i < (length - value.length); i++) {
24 | zeros += '0';
25 | }
26 | return zeros + value;
27 | };
28 |
29 | return mask.replace(/"[^"]*"|'[^']*'|\b(?:d{1,4}|m{1,4}|yy(?:yy)?|([hHMstT])\1?|[lLZ])\b/g, function ($0) {
30 | switch ($0) {
31 | case 'd':
32 | return d.getDate();
33 | case 'dd':
34 | return zeroize(d.getDate());
35 | case 'ddd':
36 | return ['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'][d.getDay()];
37 | case 'dddd':
38 | return ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][d.getDay()];
39 | case 'M':
40 | return d.getMonth() + 1;
41 | case 'MM':
42 | return zeroize(d.getMonth() + 1);
43 | case 'MMM':
44 | return ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getMonth()];
45 | case 'MMMM':
46 | return ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][d.getMonth()];
47 | case 'yy':
48 | return String(d.getFullYear()).substr(2);
49 | case 'yyyy':
50 | return d.getFullYear();
51 | case 'h':
52 | return d.getHours() % 12 || 12;
53 | case 'hh':
54 | return zeroize(d.getHours() % 12 || 12);
55 | case 'H':
56 | return d.getHours();
57 | case 'HH':
58 | return zeroize(d.getHours());
59 | case 'm':
60 | return d.getMinutes();
61 | case 'mm':
62 | return zeroize(d.getMinutes());
63 | case 's':
64 | return d.getSeconds();
65 | case 'ss':
66 | return zeroize(d.getSeconds());
67 | case 'l':
68 | return zeroize(d.getMilliseconds(), 3);
69 | case 'L':
70 | var m = d.getMilliseconds();
71 | if (m > 99) m = Math.round(m / 10);
72 | return zeroize(m);
73 | case 'tt':
74 | return d.getHours() < 12 ? 'am' : 'pm';
75 | case 'TT':
76 | return d.getHours() < 12 ? 'AM' : 'PM';
77 | case 'Z':
78 | return d.toUTCString().match(/[A-Z]+$/);
79 | // Return quoted strings with the surrounding quotes removed
80 | default:
81 | return $0.substr(1, $0.length - 2);
82 | }
83 | });
84 | };
85 |
86 |
87 |
88 | function getDate(strDate) {
89 | var date = eval('new Date(' + strDate.replace(/\d+(?=-[^-]+$)/,
90 | function (a) {
91 | return parseInt(a, 10) - 1;
92 | }).match(/\d+/g) + ')');
93 | return Format(date, "MM-dd HH:mm");
94 |
95 | }
96 |
--------------------------------------------------------------------------------
/src/main/webapp/video/js/full_screen.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/9.
3 | */
4 | function full_screen() {
5 | if ($(".barrage_video").width()+2 == $("body").width()) {
6 | // alert("a")
7 | $(".d_show").addClass("full_screen");
8 | // $(".d_show").css({width:$("#demand_video").width()})
9 | }
10 | else {
11 | // alert("b")
12 | $(".d_show").removeClass("full_screen");
13 | // $(".d_show").css({width:'100%'})
14 | }
15 | }
16 |
17 | $(document).ready(function () {
18 | document.addEventListener('fullscreenchange', function () {
19 | full_screen();
20 | });
21 |
22 | document.addEventListener('webkitfullscreenchange', function () {
23 | full_screen();
24 | });
25 |
26 | document.addEventListener('mozfullscreenchange', function () {
27 | full_screen();
28 | });
29 |
30 | document.addEventListener('MSFullscreenChange', function () {
31 | full_screen();
32 | });
33 | });
34 |
--------------------------------------------------------------------------------
/src/main/webapp/video/js/live_socket.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/11/6.
3 | */
4 |
5 | //websocket 方法组
6 | function websocket_functions() {
7 | //判断当前浏览器是否支持WebSocket
8 | if ('WebSocket' in window) {
9 | websocket = new WebSocket(ws_string + "/websocket/live/"+roomId);
10 |
11 | } else {
12 | alert('Not support websocket');
13 | }
14 | //连接发生错误的回调方法
15 | websocket.onerror = function () {
16 | console.log("error");
17 |
18 | }
19 | //连接成功建立的回调方法
20 | websocket.onopen = function (event) {
21 | console.log("open");
22 | if (!isliver()) {//不是主播
23 | requst_live_src()
24 | }else {
25 | console.log("你是主播")
26 | requst_live_src()
27 | }
28 | }
29 |
30 | //接收到消息的回调方法
31 | websocket.onmessage = function (event) {
32 | var data = JSON.parse(event.data);
33 | if(data.group=="rtc"){
34 | processSignalingMessage(data);
35 | }else {
36 | message_handle(data);
37 | }
38 | }
39 | //连接关闭的回调方法
40 | websocket.onclose = function () {
41 | console.log("close");
42 |
43 | for (var key in pc_opened_array) {
44 | if (pc_opened_array[key] != null&&pc_opened_array[key].connectionState!=="closed") {
45 | pc_opened_array[key].close();
46 | }
47 | }
48 | }
49 | }
50 |
51 |
52 | //消息处理方法
53 | function message_handle(data) {
54 | if (data.onlinenum!=null) {//更新用户在线列表
55 | $("#online").text(data.onlinenum);//围观人数刷新
56 | if (data.onlinelist != null) {//更新列表
57 | // console.log(data.onlinelist)
58 | update_onlinelist_ui(data.onlinelist);
59 |
60 | }
61 | // if (data.onlinenum>parseInt($("#online").text())) {
62 | // alert("围观数+1")
63 | // }else {
64 | // alert("围观数-1")
65 | // }
66 | }
67 | else {//接受并解析弹幕
68 | analyze_live_barrage(data.barrage);
69 | }
70 | }
71 |
72 |
73 | function update_onlinelist_ui(onlinelist) {//更新在人线数列表
74 | $("#online_list").empty();//列表刷新
75 | for (var key in onlinelist) {
76 | if(onlinelist[key]==liverName){
77 | var online_item = $("
" + onlinelist[key] + "(*主播*) |
");
78 | }else {
79 | var online_item = $("
" + onlinelist[key] + " |
");
80 | }
81 |
82 | online_item.css({color: getReandomColor()})//颜色随机
83 | $("#online_list").append(online_item);
84 | }
85 | }
86 |
87 |
88 | function close_live() {
89 | if(isliver()&&islived){
90 | var r=confirm("确定关闭直播吗?")
91 | if (r==true)
92 | {
93 | websocket.send(JSON.stringify({
94 | "group":"rtc",
95 | "type": "live_close",
96 | "data": {}
97 | }));
98 | websocket.close();
99 | window.location.reload(true);//刷新页面
100 | }
101 | }else {
102 | websocket.close();
103 | }
104 |
105 | }
106 |
107 | function isliver() {//判断主播
108 | return (userid_my!==null&&liverId!==null&&userid_my===liverId);
109 | }
--------------------------------------------------------------------------------
/src/main/webapp/video/js/send_Barrage.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/11/8.
3 | */
4 |
5 | /*//发弹幕
6 | barrageId id(扩展功能)
7 | barrageContent 弹幕内容
8 | barrageSpade 发送速度 (int倍率)
9 | barrageColor 弹幕颜色 String
10 | barrageFontSize 字体大小 int
11 | */
12 | function send_barrage(barrageId, barrageContent, barrageSpeed, barrageColor, barrageFontSize) {
13 | var barr_div = $("
" + barrageContent + "
");//装载弹幕到.show
14 | barr_div.addClass("new");
15 | $(".d_show").append(barr_div);
16 |
17 | var _top = 2;
18 | var _left = $(".barrage_video").width();
19 | var _height = $(".barrage_video").height();
20 | if (barr_div.prev().position() != null) {
21 | _top = barr_div.prev().position().top + barr_div.prev().height();
22 | // var range = 2 * _height / 3 - barr_div.height();
23 | // do{
24 | // _top= Math.random() * range
25 | // }while(Math.abs(_top-(barr_div.prev().position().top))<=barr_div.height()/2);
26 | }
27 | else {
28 | _top = 2;
29 | }
30 |
31 | if (_top >= 2 * _height / 3 - barr_div.height()) {
32 | _top = 2;
33 | }
34 | barr_div.css({"font-size": barrageFontSize + "px", left: _left, top: _top, color: barrageColor});
35 | var distance = $(".barrage_video").width() + barr_div.width();
36 | barr_div.removeClass("new");
37 | barr_div.animate({left: "-=" +distance+ "px"}, 1000 * (distance / barrageSpeed), "linear", function () {
38 | barr_div.remove();
39 | });
40 |
41 | }
42 |
43 |
44 | function myFunction() {//根据时间点发送弹幕
45 | for (key in barrage_array) {//遍历弹幕
46 | var barrage_object = barrage_array[key];
47 | // alert(parseInt(barrage_object.videoTimePrint)+"---"+this.currentTime)
48 | if (parseInt(this.currentTime) == parseInt(barrage_object.videoTimePrint)) {
49 | send_barrage(barrage_object.barrageId, barrage_object.barrageContent, barrage_object.barrageSpeed,
50 | barrage_object.barrageColor, barrage_object.barrageFontSize, barrage_object.videoTimePrint)
51 | barrage_array.splice(key, 1);
52 | }
53 | }
54 | }
55 |
56 |
57 | function demand_send_Barrage() {//点播发送弹幕
58 | if (!islogined) {
59 | alert("请先登录");
60 | return;
61 | }
62 |
63 | var barrageContent = $("#barr_text").val();
64 | var barrageSpeed = $("#speed_btns .clicked").val();
65 | var barrageFontSize = $("#size_btns .clicked").val();
66 | var barrageColor = $("#sendcolor").val();
67 | var videoTimePrint = $("#demand_video")[0].currentTime;//发送的视频时间节点
68 | var videoId_ = videoId;
69 | // var userId = userid_my;
70 |
71 | if(barrageContent!=null&&barrageContent.length>0){
72 | send_barrage(null, barrageContent, barrageSpeed, barrageColor, barrageFontSize);//上屏
73 |
74 | $.ajax({
75 | type: "POST",
76 | url: "../ajax/insert_Barr_barragesJsonAction",
77 | dataType: "json",
78 | cache:false,
79 | data: {
80 | barrageContent: barrageContent,
81 | barrageSpeed: barrageSpeed,
82 | barrageColor: barrageColor,
83 | barrageFontSize: barrageFontSize,
84 | videoTimePrint: videoTimePrint,
85 | 'barrage_video.videoId': videoId_
86 | // ,'barr_user.userId': userId
87 | },
88 | success: function (data) {
89 | if (data.success) {
90 | $("#barr_text").val("");
91 | console.log("insert barrage success");
92 | }
93 | else {
94 | console.log("insert barrage failure");
95 | }
96 | }
97 | ,
98 | error: function (jqXHR) {
99 | alert("错误提示: " + jqXHR.status + " " + jqXHR.statusText);
100 | }
101 | });
102 |
103 | }
104 | }
105 |
106 | function live_send_Barrage(state) {//直播发送弹幕
107 | //State 1 群发弹幕
108 | // 2 用户下线
109 | // 0 用户手动登陆
110 | if (!islogined) {
111 | alert("请先登录!");
112 | return;
113 | }
114 | if (!islived) {
115 | alert("直播还未开始哟");
116 | return;
117 | }
118 |
119 |
120 |
121 | var barrageContent = $("#barr_text").val().trim();
122 | var barrageSpade = $("#speed_btns .clicked").val();
123 | var barrageFontSize = $("#size_btns .clicked").val();
124 | var barrageColor = $("#sendcolor").val();
125 |
126 | // send_barrage(null, barrageContent, barrageSpade, barrageColor, barrageFontSize);//上屏
127 |
128 | if(barrageContent!=null&&barrageContent.length>0){
129 |
130 | websocket.send(JSON.stringify({
131 | "group":"danmu",
132 | "state": state,
133 | "barrage": {
134 | "barrageContent": barrageContent,
135 | "barrageSpeed": barrageSpade,
136 | "barrageColor": barrageColor,
137 | "barrageFontSize": barrageFontSize
138 | }
139 | }));
140 |
141 | $("#barr_text").val("");
142 |
143 | }
144 |
145 | }
146 |
147 | function analyze_live_barrage(barrage) {//解析直播发过来的弹幕并上屏
148 | // var barr = barrage.barrageContent + "---" + barrage.barrageColor + "---" + barrage.barrageSpade + "---" + barrage.barrageFontSize;
149 | // alert(barr);
150 | send_barrage(null,barrage.barrageContent,barrage.barrageSpeed,barrage.barrageColor,barrage.barrageFontSize)
151 |
152 | }
153 |
154 |
155 | //获取随机颜色
156 | function getReandomColor() {
157 | return '#' + (function (h) {
158 | return new Array(7 - h.length).join("0") + h
159 | })((Math.random() * 0x1000000 << 0).toString(16))
160 | }
--------------------------------------------------------------------------------
/src/main/webapp/video/js/ui.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by johl on 2016/11/10.
3 | */
4 |
5 | function isclick() {//单选按钮组事件
6 | $(this).parent().find("button").each(function (i, v) {
7 | if ($(this)[0] == event.target) {
8 | $(this).addClass("clicked");
9 | $(this).css({background_color: "#4285F4"})
10 | }
11 | else {
12 | $(this).removeClass("clicked");
13 | }
14 | });
15 | }
16 |
17 |
18 | $(document).ready(function () {
19 |
20 | $("#sendfont_size").on("click", function () {
21 | if ($("#sendfontchoose_panle").css("display") == "none") {
22 | $("#sendfontchoose_panle").show();
23 | $("#size_btns").show();
24 | } else {
25 | if ($("#size_btns").css("display") == "none") {
26 | $("#size_btns").show();
27 | $("#speed_btns").hide();
28 | }
29 | else {
30 | $("#sendfontchoose_panle").hide();
31 | $("#size_btns").hide();
32 | }
33 | }
34 | });
35 |
36 | $("#sendfont_speed").on("click", function () {
37 | if ($("#sendfontchoose_panle").css("display") == "none") {
38 | $("#sendfontchoose_panle").show();
39 | $("#speed_btns").show();
40 | } else {
41 | if ($("#speed_btns").css("display") == "none") {
42 | $("#speed_btns").show();
43 | $("#size_btns").hide();
44 | }
45 | else {
46 | $("#sendfontchoose_panle").hide();
47 | $("#speed_btns").hide();
48 | }
49 | }
50 | });
51 |
52 | $("#sendfontchoose_panle button").on("click", isclick)
53 | $("#sendcolor").colorpicker({
54 | fillcolor: true,
55 | target: "#jADFV******FV7FW",
56 | success: function (o, color) {
57 | $("#sendcolor").val(color)
58 | $("#barr_text").css({color: color});
59 | }
60 | });
61 |
62 | $(".fontbutton_config").mouseenter(function () {
63 | $(this).css({"background-color": "#4285F4"});
64 | $(this).css({"color": "white"});
65 | });
66 | $(".fontbutton_config").mouseleave(function () {
67 | $(this).css({"background-color": "white"});
68 | $(this).css({"color": "black"});
69 | });
70 |
71 | $("#sendfont_size").on("click", function () {
72 | $("#colorpanel").hide();
73 | });
74 |
75 | $("#sendfont_speed").on("click", function () {
76 | $("#colorpanel").hide();
77 | });
78 |
79 | $("#sendcolor").on("click", function () {
80 | $("#sendfontchoose_panle").hide();
81 | $("#speed_btns").hide();
82 | $("#size_btns").hide();
83 | });
84 |
85 |
86 | $("#barr_text").keydown(function (event) {
87 | if(event.which==13){
88 | if(videopage_type=="demand"){
89 | demand_send_Barrage();
90 | }else
91 | {
92 | live_send_Barrage(1)
93 | }
94 | }
95 | });
96 |
97 |
98 |
99 |
100 | });
101 |
102 |
--------------------------------------------------------------------------------
/src/main/webapp/vip/css/fileinput.min.css:
--------------------------------------------------------------------------------
1 | /*!
2 | * @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2015
3 | * @package bootstrap-fileinput
4 | * @version 4.1.8
5 | *
6 | * File input styling for Bootstrap 3.0
7 | * Built for Yii Framework 2.0
8 | * Author: Kartik Visweswaran
9 | * Year: 2015
10 | * For more Yii related demos visit http://demos.krajee.com
11 | */
12 | .file-input {
13 | overflow-x: auto
14 | }
15 |
16 | .file-loading {
17 | top: 0;
18 | right: 0;
19 | width: 25px;
20 | height: 25px;
21 | font-size: 999px;
22 | text-align: right;
23 | color: #fff;
24 | background: transparent url(../../img/loading.gif) top left no-repeat;
25 | border: none
26 | }
27 |
28 | .btn-file {
29 | position: relative;
30 | overflow: hidden
31 | }
32 |
33 | .btn-file input[type=file] {
34 | position: absolute;
35 | top: 0;
36 | right: 0;
37 | min-width: 100%;
38 | min-height: 100%;
39 | text-align: right;
40 | filter: alpha(opacity=0);
41 | opacity: 0;
42 | background: none repeat scroll 0 0 transparent;
43 | cursor: inherit;
44 | display: block
45 | }
46 |
47 | .file-caption .glyphicon {
48 | display: inline-block;
49 | min-width: 18px;
50 | float: left;
51 | margin-top: 2px
52 | }
53 |
54 | .file-caption-name {
55 | display: inline-block;
56 | overflow: hidden;
57 | max-height: 20px;
58 | padding-right: 10px;
59 | word-break: break-all
60 | }
61 |
62 | .file-caption-ellipsis {
63 | position: absolute;
64 | right: 10px;
65 | margin-top: -6px;
66 | font-size: 1.2em;
67 | display: none;
68 | font-weight: 700;
69 | cursor: default
70 | }
71 |
72 | .kv-has-ellipsis .file-caption-ellipsis {
73 | display: inline
74 | }
75 |
76 | .kv-has-ellipsis {
77 | padding-right: 17px
78 | }
79 |
80 | .kv-search-container .kv-search-clear {
81 | position: absolute;
82 | padding: 10px;
83 | right: 0
84 | }
85 |
86 | .file-error-message {
87 | background-color: #f2dede;
88 | color: #a94442;
89 | text-align: center;
90 | border-radius: 5px;
91 | padding: 5px
92 | }
93 |
94 | .file-error-message pre, .file-error-message ul {
95 | text-align: left;
96 | margin: 5px 0
97 | }
98 |
99 | .file-caption-disabled {
100 | background-color: #EEE;
101 | cursor: not-allowed;
102 | opacity: 1
103 | }
104 |
105 | .file-input .btn .disabled, .file-input .btn[disabled] {
106 | cursor: not-allowed
107 | }
108 |
109 | .file-preview {
110 | border-radius: 5px;
111 | border: 1px solid #ddd;
112 | padding: 5px;
113 | width: 100%;
114 | margin-bottom: 5px;
115 | height: 100%;
116 |
117 | }
118 |
119 | .file-preview-frame {
120 | display: table;
121 | margin: 0 auto;
122 | height: 150px;
123 | border: 1px solid #ddd;
124 | box-shadow: 1px 1px 5px 0 #a2958a;
125 | padding: 6px;
126 | float: left;
127 | text-align: center;
128 | vertical-align: middle
129 | }
130 |
131 | .file-preview-frame:hover {
132 | box-shadow: 3px 3px 5px 0 #333
133 | }
134 |
135 | .file-preview-image {
136 | height: 160px;
137 | vertical-align: text-center
138 | }
139 |
140 | .file-preview-text {
141 | width: 160px;
142 | color: #428bca;
143 | font-size: 11px;
144 | text-align: center
145 | }
146 |
147 | .file-preview-other {
148 | padding-top: 48px;
149 | text-align: center
150 | }
151 |
152 | .file-preview-other i {
153 | font-size: 2.4em
154 | }
155 |
156 | .file-other-error {
157 | width: 100%;
158 | padding-top: 30px;
159 | text-align: right
160 | }
161 |
162 | .file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button, .file-input-new .close, .file-input-new .file-preview, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button, .file-input-new .glyphicon-file {
163 | display: none
164 | }
165 |
166 | .loading {
167 | background: transparent url(../../img/loading.gif) no-repeat scroll center center content-box !important
168 | }
169 |
170 | .wrap-indicator {
171 | font-weight: 700;
172 | color: #245269;
173 | cursor: pointer
174 | }
175 |
176 | .file-actions {
177 | display: none;
178 | text-align: left
179 | }
180 |
181 | .file-footer-buttons {
182 | float: right
183 | }
184 |
185 | .file-thumbnail-footer .file-caption-name {
186 | padding-top: 4px;
187 | font-size: 11px;
188 | color: #777
189 | }
190 |
191 | .file-upload-indicator {
192 | padding-top: 2px;
193 | cursor: default
194 | }
195 |
196 | .file-upload-indicator:hover {
197 | font-size: 1.2em;
198 | font-weight: 700;
199 | padding-top: 0
200 | }
201 |
202 | .file-drop-zone {
203 | border: 1px dashed #aaa;
204 | border-radius: 4px;
205 | height: 100%;
206 | text-align: center;
207 | vertical-align: middle;
208 | margin: 12px 15px 12px 12px;
209 | padding: 5px
210 | }
211 |
212 | .file-drop-zone-title {
213 | color: #aaa;
214 | font-size: 40px;
215 | height: 80%;
216 | padding: 85px 10px
217 | }
218 |
219 | .highlighted {
220 | border: 2px dashed #999 !important;
221 | background-color: #f0f0f0
222 | }
223 |
224 | .file-uploading {
225 | background-image: url(../../img/loading-sm.gif);
226 | background-position: center bottom 10px;
227 | background-repeat: no-repeat;
228 | opacity: .6
229 | }
230 |
231 | .file-icon-large {
232 | font-size: 1.2em
233 | }
--------------------------------------------------------------------------------
/src/main/webapp/vip/img/bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/vip/img/bg.jpg
--------------------------------------------------------------------------------
/src/main/webapp/vip/img/icons_m.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/vip/img/icons_m.png
--------------------------------------------------------------------------------
/src/main/webapp/vip/img/rl_top2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/vip/img/rl_top2.jpg
--------------------------------------------------------------------------------
/src/main/webapp/vip/img/rl_topbg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/coderzc/biubiu/10b917546a5343a0b67b31d1b76ab4e5f68ea9e6/src/main/webapp/vip/img/rl_topbg.png
--------------------------------------------------------------------------------
/src/main/webapp/vip/js/ajax_upload.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by zc on 2016/12/26.
3 | */
4 | ;(function ($) {
5 | var defaults = {
6 | uploadProgress: null,
7 | beforeSend: null,
8 | success: null,
9 | },
10 | setting = {};
11 |
12 | var upload = function ($this) {
13 | $this.parent().on('change', $this, function (event) {
14 | //var $this = $(event.target),
15 | var formData = new FormData(),
16 | target = event.target || event.srcElement;
17 | //$.each(target.files, function(key, value)
18 | //{
19 | // console.log(key);
20 | // formData.append(key, value);
21 | //});
22 | formData.append('file', target.files[0]);
23 | formData.append("fileContentType", target.files[0].type);
24 | formData.append("fileFileName", target.files[0].name);
25 |
26 | settings.fileType && formData.append('fileType', settings.fileType);
27 |
28 | $.ajax({
29 | url: $this.data('url'),
30 | type: "POST",
31 | data: formData,
32 | dataType: 'json',
33 | processData: false,
34 | contentType: false,
35 | cache: false,
36 | beforeSend: function () {
37 | //console.log('start');
38 | if (settings.beforeSend) {
39 | settings.beforeSend();
40 | }
41 | },
42 | xhr: function () {
43 | var xhr = $.ajaxSettings.xhr();
44 | if (xhr.upload) {
45 | xhr.upload.addEventListener('progress', function (event) {
46 | var total = event.total,
47 | position = event.loaded || event.position,
48 | percent = 0;
49 | if (event.lengthComputable) {
50 | percent = Math.ceil(position / total * 100);
51 | }
52 | if (settings.uploadProgress) {
53 | settings.uploadProgress(event, position, total, percent);
54 | }
55 |
56 | }, false);
57 | }
58 | return xhr;
59 | },
60 | success: function (data, status, jXhr) {
61 | if (settings.success) {
62 | settings.success(data);
63 | }
64 | },
65 | error: function (jXhr, status, error) {
66 | if (settings.error) {
67 | settings.error(jXhr, status, error);
68 | }
69 | }
70 | });
71 | });
72 | };
73 | $.fn.uploadFile = function (options) {
74 | settings = $.extend({}, defaults, options);
75 | // 文件上传
76 | return this.each(function () {
77 | upload($(this));
78 | });
79 | }
80 | })($ || jQuery);
--------------------------------------------------------------------------------
/src/main/webapp/vip/js/fileinput_locale_zh.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * FileInput Spanish (Latin American) Translations
3 | *
4 | * This file must be loaded after 'fileinput.js'. Patterns in braces '{}', or
5 | * any HTML markup tags in the messages must not be converted or translated.
6 | *
7 | * @see http://github.com/kartik-v/bootstrap-fileinput
8 | *
9 | * NOTE: this file must be saved in UTF-8 encoding.
10 | */
11 | (function ($) {
12 | "use strict";
13 | $.fn.fileinput.locales.es = {
14 | fileSingle: '单个文件',
15 | filePlural: '多个文件',
16 | browseLabel: '选择文件 …',
17 | removeLabel: '删除文件',
18 | removeTitle: '删除选中文件',
19 | cancelLabel: '取消',
20 | cancelTitle: '取消上传',
21 | uploadLabel: '上传',
22 | uploadTitle: '上传选中文件',
23 | msgSizeTooLarge: 'File "{name}" (
{size} KB) exceeds maximum allowed upload size of
{maxSize} KB. Please retry your upload!',
24 | msgFilesTooLess: '文件数量必须大于
{n} {files} ,请重新上传!',
25 | msgFilesTooMany: 'Number of files selected for upload
({n}) exceeds maximum allowed limit of
{m}. Please retry your upload!',
26 | msgFileNotFound: '文件 "{name}" 未找到!',
27 | msgFileSecured: 'Security restrictions prevent reading the file "{name}".',
28 | msgFileNotReadable: 'File "{name}" is not readable.',
29 | msgFilePreviewAborted: 'File preview aborted for "{name}".',
30 | msgFilePreviewError: 'An error occurred while reading the file "{name}".',
31 | msgInvalidFileType: 'Invalid type for file "{name}". Only "{types}" files are supported.',
32 | msgInvalidFileExtension: 'Invalid extension for file "{name}". Only "{extensions}" files are supported.',
33 | msgValidationError: 'File Upload Error',
34 | msgLoading: 'Loading file {index} of {files} …',
35 | msgProgress: 'Loading file {index} of {files} - {name} - {percent}% completed.',
36 | msgSelected: '选中{n}个文件',
37 | msgFoldersNotAllowed: 'Drag & drop files only! {n} folder(s) dropped were skipped.',
38 | dropZoneTitle: '拖拽文件到这里'
39 | };
40 |
41 | $.extend($.fn.fileinput.defaults, $.fn.fileinput.locales.es);
42 | })(window.jQuery);
43 |
--------------------------------------------------------------------------------
/src/main/webapp/vip/js/upload_video.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 |
3 | $("#upload_video").on("change", function () {
4 | $(".file-other-error.text-danger").parent().remove();
5 | });
6 |
7 |
8 | $("#upload_video").fileinput({
9 | language: 'zh', //设置语言
10 | uploadUrl: '../ajax/upload-video', // you must set a valid URL here else you will get an error
11 | maxFileSize: 2000000,
12 | maxFileCount: 1, //表示允许同时上传的最大文件个数
13 | dropZoneEnabled: true,//是否显示拖拽区域
14 | showUpload: true,
15 | showCaption: true,//是否显示标题
16 | showPreview: true,//是否显示预览
17 | overwriteInitial: true,//是否覆盖已经存在的图片
18 | validateInitialCount: true,
19 | allowedFileTypes: ["video"],
20 | previewFileIcon: '
',
21 | allowedPreviewTypes: "text",
22 | // browseClass:"" ,
23 | slugCallback: function (filename) {
24 | return filename.replace('(', '_').replace(']', '_');
25 |
26 | }
27 | });
28 |
29 |
30 | $("#uploadfile").on('fileselect', function (event, n, l) {//更改上传文件触发
31 | // alert('File Selected. Name: ' + l + ', Num: ' + n);
32 | // $(".file-other-error.text-danger").parent().remove();
33 | $(".file-preview-frame").remove();
34 |
35 | });
36 |
37 |
38 | //异步上传失败返回结果处理
39 | $('#upload_video').on('fileerror', function (event, data, msg) {
40 | console.log(data.id);
41 | console.log(data.index);
42 | console.log(data.file);
43 | console.log(data.reader);
44 | console.log(data.files);
45 | // get message
46 |
47 | alert("上传失败!");
48 | });
49 | //异步上传成功返回结果处理
50 | $("#upload_video").on("fileuploaded", function (event, data, previewId, index) {
51 | console.log(data);
52 | console.log(data.id);
53 | console.log(data.index);
54 | console.log(data.file);
55 | console.log(data.reader);
56 | console.log(data.files);
57 | var obj = data.response;
58 | if (obj.success) {
59 |
60 | setTimeout(function () {
61 |
62 | alert("上传成功");
63 |
64 | $(".cover-wrp .cover-box").css({
65 | "background-image": "url(" + obj.videoCoverURL + ")",
66 | "border":"none"
67 | });
68 |
69 | $("#videopath").val(obj.videoURI);
70 | $("#videocoverpath").val(obj.videoCoverURI);
71 | is_uploaded = true;
72 |
73 | },100)
74 |
75 | } else {
76 | alert("上传失败");
77 | }
78 |
79 | });
80 |
81 |
82 | //isDiy 单选操作
83 | $(".control-group label").on("click", function () {
84 | $(".control-group input").removeClass("is-checked");
85 | $(this).find("input").addClass("is-checked");
86 | });
87 |
88 |
89 | //videoType单选操纵
90 | $(".section.type-wrp .type-btn").on("click", function () {
91 | $(".section.type-wrp .type-btn").removeClass("is-selected");
92 | $(this).addClass("is-selected");
93 | $("#videotype").val($(this).val());
94 |
95 | });
96 |
97 | //标题框
98 | $(".bili-input").on("input", function () {
99 | var length = $(this).val().length;
100 | // alert(length);
101 | $(".title-wrp .count-wrp").text(length + "/80")
102 | });
103 |
104 |
105 | //提交视频信息
106 | $('#video_form').submit(
107 | function () {
108 | if (is_uploaded) {
109 | $.ajax({
110 | type: "POST",
111 | url: server_path + "/ajax/video_submit",
112 | dataType: "json",
113 | data: $('#video_form').serializeArray(),// 提交表单
114 | success: function (data) {
115 | if (data.success) {
116 | // alert("投稿成功!");
117 |
118 | $("#submiting").hide();
119 |
120 | $(".success-wrp .outline").text(data.videoTitle);
121 | $(".success-wrp .video_url_").text(full_path + "/video/demand?video_id=" + data.videoId);
122 | $(".success-wrp .pic img").attr("src", $("#videocoverpath").val());
123 |
124 | $("#submited").show();
125 |
126 | $("#go_video").attr("href", server_path + "/video/demand?video_id=" + data.videoId);
127 | $("#again_video").attr("href", server_path + "vip/upload_video");
128 |
129 | }
130 | else {
131 | alert("投稿失败!");
132 | }
133 | },
134 | error: function (jqXHR) {
135 | alert("错误提示: " + jqXHR.status + " " + jqXHR.statusText);
136 | }
137 | });
138 |
139 | } else {
140 | alert("请等待视频上传成功在发布");
141 | }
142 |
143 |
144 | return false;
145 | });
146 |
147 |
148 | })
149 |
150 |
151 |
152 |
153 |
154 |
155 |
--------------------------------------------------------------------------------
/src/main/webapp/vip/js/userinfo_setting.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 | $('#sex_ul li').click(function () {
3 | var $this = $(this);
4 | $('#sex_ul li').removeClass('blue');
5 | $this.addClass('blue');
6 | $('#select_sex').val($this.data('sex'));
7 | });
8 | var _sex = $('#select_sex').val();
9 | $('#sex_ul li').each(function () {
10 | if (_sex == $(this).data('sex')) {
11 | $(this).addClass('blue');
12 | } else {
13 | $(this).removeClass('blue');
14 | }
15 | })
16 |
17 | $('#user_info_form').submit(
18 | function () {
19 | $.ajax({
20 | type: "POST",
21 | url: server_path + "/ajax/userAjax-uinfo",
22 | dataType: "json",
23 | data: $('#user_info_form').serializeArray(),// 提交表单
24 | success: function (data) {
25 | if (data.success) {
26 | alert("信息修改成功!");
27 | window.location.reload(true);
28 | }
29 | else {
30 | alert("信息修改失败!");
31 | }
32 | },
33 | error: function (jqXHR) {
34 | alert("错误提示: " + jqXHR.status + " " + jqXHR.statusText);
35 | }
36 | });
37 |
38 |
39 | return false;
40 | });
41 | });
42 |
--------------------------------------------------------------------------------
/src/main/webapp/vip/security-list.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2 |
3 |
89 |
--------------------------------------------------------------------------------
/src/main/webapp/vip/user_info.jsp:
--------------------------------------------------------------------------------
1 | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
2 | <%
3 | String path = request.getContextPath();
4 | pageContext.setAttribute("path", path);
5 | %>
6 |
7 |
8 |
9 |
个人中心-biubiu
10 | <%@include file="../inclued_page/base_js_css.jsp" %>
11 |
12 |
13 |
14 |
15 | <%@include file="../inclued_page/nav.jsp" %>
16 |
19 |
20 | <%@include file="security-list.jsp" %>
21 |
101 |
102 | <%@include file="../inclued_page/model_login.jsp" %>
103 |
104 |
120 |
121 |
--------------------------------------------------------------------------------
/src/test/java/HibnerateTest.java:
--------------------------------------------------------------------------------
1 | import com.action.LiveAction;
2 | import com.entity.Barrages;
3 | import com.entity.Users;
4 | import com.entity.Videos;
5 | import com.utils.HibernateUtils;
6 | import org.hibernate.Session;
7 | import org.hibernate.Transaction;
8 |
9 | import java.util.HashMap;
10 |
11 | public class HibnerateTest {
12 | public static void main(String[] args) {
13 | // Session session = HibernateUtils.getCurrentSession();
14 | // Transaction tx = session.beginTransaction();
15 | // try {
16 | //
17 | // Barrages barrages = new Barrages();
18 | // barrages.setBarr_user((Users) HibernateUtils.getCurrentSession().get(Users.class, "13061282767"));
19 | // barrages.setBarrage_video((Videos) HibernateUtils.getCurrentSession().get(Videos.class, "av62813213"));
20 | // barrages.setBarrageColor("#ffffff");
21 | // barrages.setBarrageFontSize(22);
22 | // barrages.setBarrageSpeed(190);
23 | // barrages.setBarrageContent("lalallalallalalalal");
24 | // barrages.setVideoTimePrint((float) 134.970927);
25 | // session.save(barrages);
26 | // tx.commit();
27 | // } catch (Exception ce) {
28 | // if (tx != null) {
29 | // tx.rollback();
30 | // }
31 | // ce.printStackTrace();
32 | // }
33 |
34 |
35 | }
36 |
37 | }
--------------------------------------------------------------------------------