admin管理员组

文章数量:1308600

I am developing a website where users can upload and watch videos. I have never done anything like this before and needs some guidance. I want the videos to be stored on my server and users can search and watch them from a video player on my website. What are the java libraries to implements this and what are the other technologies I will need.

I am developing a website where users can upload and watch videos. I have never done anything like this before and needs some guidance. I want the videos to be stored on my server and users can search and watch them from a video player on my website. What are the java libraries to implements this and what are the other technologies I will need.

Share Improve this question asked Jan 1, 2013 at 1:39 Mario DennisMario Dennis 3,01613 gold badges37 silver badges50 bronze badges 3
  • 1 Why do you want to use Java to do this? – aly Commented Jan 1, 2013 at 1:52
  • Well, i'm using java on the server side so I'm assuming that I will need it to implement these functionality[Not really sure correct me if i'm wrong]. – Mario Dennis Commented Jan 1, 2013 at 1:55
  • Are the videos created with a web cam? Flash does that very well in conjunction with Java back ends like Red5 or Wowza. – Sunil D. Commented Jan 1, 2013 at 3:02
Add a ment  | 

3 Answers 3

Reset to default 5

Here's a list of Technologies you can consider to use or study.

  1. JSP + Servlet = You would implement your own MVC implementation(Though I would not remend this if you are building a large scale application unless you are really good at it. Consider Number 2)

  2. Consider To Use an MVC framework(like Struts2, Spring MVC etc.) or like what Thorn Said, a REST framework like Jersey(Though I have not tried using a REST framework).

  3. Database Access - Do I need to explain why?

  4. An ORM library - using an ORM can speed up development(this can be subjective though), it makes data access more abstract and portable,ORM implementation classes know how to write vendor-specific SQL.

  5. File Upload library - if you are going to use as Struts2 your framework once of its depencies is the Apache Commons Library(Just check their documentation).

You've said that the users will upload their videos and you will store them in your server and you will play those videos in their web-browser you need to do File convertions, Why?

in HTML5, since not all browsers support all video formats, so you need to consider converting the video to another format if you are going for an html5 player. you can check out different file formats that different browser supports here

For File conversion check this Here

Now for the client side video, you can Use the MediaElement.js it has a flash fallback, just in case that users video does not support HTML5.

First check out this for your player:

Player

Now your logic needs to be a little different. You should make thumbnails of the videos and send them to the player with a link. This way you only need one setup of the player and pass the url information into it.

Rather than starting this project with a list of technologies you need to master, I would remend starting with an outline of what you want it to look like - how will the user interact with the site? What functionality will it have and how do you want this exposed to the user? Next I would think about the data. How will it be stored? How will the video files be names and associated with users? What attributes of the videos do we need to store? For example, each video file can have an associated user (who posted it), some attributes, like date, file size, resolution, frame rate. Will we also be storing ments or ratings? Keywords? A Description? Probably you will want a database to store this data, but I would just store the video files as regular files in the directory.

Now onto choosing a set of tools to get this done...

  1. Java Servlets or a REST framework like Jersey.
  2. File upload using an Apache mons library (probably no need for this if using Jersey framework)
  3. Database access
  4. HTML 5 video playback or Flash video or JavaFX 2

With HTML5 (browser based video playback without a plug-in) is not supported on all browsers yet.

A search feature could also be done in Java. You would need some database skills here and to do search well is far from trivial. But a basic search where you give the application a keyword and it gives you all videos listing this keyword should be simple.

本文标签: javascriptVideo Streaming on website using javaStack Overflow