当前位置: 首页 > news >正文

上海专业网站设计巩义网络推广外包

上海专业网站设计,巩义网络推广外包,龙岗在线官网,青柠影院观看免费高清电视剧1 出发点及效果图 手机存储空间太小,放不下几十级的视频,网络看又太卡。这个小项目帮助大家在局域网中建立一个像youku一样的视频服务器,这样就可以在家里通过局域网来观看服务 器(计算机)上的视频了。(不要…

1 出发点及效果图
手机存储空间太小,放不下几十级的视频,网络看又太卡。这个小项目帮助大家在局域网中建立一个像youku一样的视频服务器,这样就可以在家里通过局域网来观看服务
器(计算机)上的视频了。(不要做羞羞的事情哟)

2 原理
主要是利用了html中的vedio标签,在tomcat服务器下播放指定文件夹中的mp4视频。
2.1 源码展示
2.1.1 获得视频列表的工具类

import java.util.ArrayList;public class file {private static String path = "E:/apache-tomcat-7.0.62/apache-tomcat-7.0.62/webapps/vedio";/*** * @param dir* @throws Exception*/static void showAllFiles(File dir) throws Exception {File[] fs = dir.listFiles();for (int i = 0; i < fs.length; i++) {System.out.println(fs[i].getName());if (fs[i].isDirectory()) {try {showAllFiles(fs[i]);} catch (Exception e) {}}}}public static ArrayList<String> getallfiles() throws Exception {File dir = new File(path);File[] fs = dir.listFiles();ArrayList<String> filelist = new ArrayList<String>();for (int i = 0; i < fs.length; i++) {System.out.println(fs[i].getName());if (fs[i].isDirectory()) {try {showAllFiles(fs[i]);} catch (Exception e) {}} else {filelist.add(fs[i].getName());}}return filelist;}public static void main(String[] args) {File root = new File(path);try {showAllFiles(root);} catch (Exception e) {// TODO Auto-generated catch blocke.printStackTrace();}}}
2.1.2 播放视频的jsp代码

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%String path = request.getContextPath();String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";String vediopath = (String) request.getAttribute("vediopath");
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>"><title>My JSP 'playmyvedio.jsp' starting page</title><meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
<!--<link rel="stylesheet" type="text/css" href="styles.css">--></head><body><video controls autobuffer> <source src="http://192.168.7.101:8080/vedio/<%=vediopath%>"type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'></source> </video>
</body>
</html>
3 项目下载

http://download.csdn.net/detail/zhounanzhaode/8905437

4 使用
4.1 安装tomcat7.0以上版本

4.2 部署项目

4.3 在webapp目录下面建立vedio目录用来存放视频



5 局限

只能播mp4,其它的没有试过,有可能能播,但是mp4效果是最好的。推荐用狸窝全能视频转换器转成mp4。


http://www.yidumall.com/news/474.html

相关文章:

  • 外贸网站建设 义乌seo优化专员编辑
  • ui设计是学什么的宁波seo网络推广选哪家
  • 做网站哪家公司重庆seo招聘
  • 西安公司排行榜网站关键词优化教程
  • 国外网站加速神器新品上市怎么推广词
  • 网站移动端指的是什么零售客户电商网站
  • 网站开发说明文档数字营销案例
  • 网站开发技术交流seo文章代写一篇多少钱
  • wordpress自动文章时间插件seo排名快速优化
  • cn域名注册网站软文营销的写作技巧有哪些
  • 武汉做胃镜国医堂z网站百度指数代表什么
  • 想开一个网站开发的公司推广普通话的宣传标语
  • 中国电信网站备案系统网络营销与直播电商专业就业前景
  • 苏州注册公司代办360优化关键词
  • 网站建设的基本原则it培训机构出来能找到工作吗
  • 做任务的阅币漫画网站seo怎么优化关键词排名培训
  • 做惠而浦售后网站赚钱佛山做seo推广公司
  • 大良网站建设公司百度平台交易
  • 做破解软件网站赚广告费刚刚突发1惊天大事
  • 常德最新确诊人员名单做seo需要哪些知识
  • 查看网站建设的特点页面优化算法
  • 灯塔网站制作公司免费发布友链
  • wordpress 合并css网站seo推广公司靠谱吗
  • 做一个网站需要多少钱 怎么做中国国家培训网是真的吗
  • 武汉专业网站建设引流获客app下载
  • 企业为什么建立企业网站产品软文代写
  • 嘉兴市平湖市建设局网站sem投放
  • 深圳网站建设案例免费发布信息
  • 虹口免费网站制作百度开户联系方式
  • 网站开发的开发工具浏览器网站进入口