-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d420fd6
Showing
367 changed files
with
55,899 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
log/*.log | |||
tmp/**/* | |||
.DS_Store | |||
doc/api | |||
doc/app | |||
doc/guides/ | |||
doc/plugins | |||
doc/models.svg | |||
doc/controllers.svg | |||
doc/machines.svg | |||
db/test.sqlite3 | |||
db/development.sqlite3 | |||
vendor/gems/*/doc/ | |||
vendor/gems/*/rdoc/ | |||
vendor/rails | |||
coverage | |||
tags | |||
config/database.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
require 'capistrano/version' | |||
load 'deploy' if respond_to?(:namespace) # cap2 differentiator | |||
load 'config/deploy' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,43 @@ | |||
YouCast™ is an open source Ruby on Rails video sharing application that you host on your own servers. It can be rebranded easily for your company or used as is. It is similar to a very simplified YouTube. Upload videos in any format and view them in the included Flash player. It doesn't do background processing of video yet. | |||
|
|||
Main features: | |||
|
|||
Upload videos, images, and music via web or mobile phone via SMS/MMS attachment | |||
Create a playlist of your videos, images, and music | |||
Play your media in a Flash player | |||
Get the code for the player to embed in any site (myspace, blog, etc) | |||
Generates thumbnails for videos | |||
Multi-user support with user login and user management | |||
Export your playlist in XSPF/Spiff format | |||
|
|||
Tech specs: | |||
|
|||
Ruby on Rails application designed with RESTful methodology | |||
Supports all major video and image formats, and mp3 for music | |||
Encodes all video to Flash | |||
Uses MMS2R for mobile media processing | |||
XSPF/Spiff format used for playlists for maximum portability | |||
|
|||
What can you do with YouCast™? | |||
|
|||
Create an internal video sharing site for your company or small business | |||
Use it as a base for your own video-related site | |||
Merge it with your existing site to add video and mobile media support | |||
Re-create YouTube to impress your friends | |||
|
|||
How much does it cost? | |||
|
|||
YouCast™ is free, but please consider donating to the project via GitHub. | |||
|
|||
Installing ffmpeg | |||
----------------- | |||
http://www.thisismobility.com/blog/?p=156 | |||
ffmpeg sources + AMR 3gpp files: /vendors/ffmpeg | |||
http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%E2%80%93-the-easy-way/ | |||
|
|||
# Install LAME | |||
# compile ffmpeg from source in vendor/ffmpeg | |||
# copy files for amr from 3gp site (included in vendor/ffmpeg) | |||
# copy amr files into libavcodec (included in vendor/ffmpeg) | |||
# compile with gmake | |||
# ./configure --enable-shared --enable-libmp3lame --enable-amr-nb --enable-amr-wb --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
# Add your own tasks in files placed in lib/tasks ending in .rake, | |||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | |||
|
|||
require(File.join(File.dirname(__FILE__), 'config', 'boot')) | |||
|
|||
require 'rake' | |||
require 'rake/testtask' | |||
require 'rake/rdoctask' | |||
|
|||
require 'tasks/rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
# Filters added to this controller apply to all controllers in the application. | |||
# Likewise, all the methods added will be available for all controllers. | |||
|
|||
class ApplicationController < ActionController::Base | |||
include AuthenticatedSystem | |||
before_filter :login_from_cookie | |||
|
|||
# Pick a unique cookie name to distinguish our session data from others' | |||
session :session_key => '_upload2_session_id' | |||
|
|||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
class ClipsController < ApplicationController | |||
before_filter :login_required | |||
before_filter :find_playlist | |||
|
|||
# GET /clips | |||
# GET /clips.xml | |||
def index | |||
@clips = Clip.find_all_by_user_id(current_user.id) | |||
|
|||
respond_to do |format| | |||
format.html # index.html.erb | |||
format.xml { render :xml => @clips } | |||
end | |||
end | |||
|
|||
# GET /clips/new | |||
# GET /clips/new.xml | |||
def new | |||
@clip = Clip.new | |||
@your_email = "#{current_user.login}@#{DOMAIN}" | |||
|
|||
respond_to do |format| | |||
format.html # new.html.erb | |||
format.xml { render :xml => @clip } | |||
end | |||
end | |||
|
|||
# POST /clips | |||
# POST /clips.xml | |||
def create | |||
@clip = Clip.new(params[:clip]) | |||
@clip.user_id = current_user.id | |||
|
|||
respond_to do |format| | |||
if @clip.save | |||
flash[:notice] = 'Clip was successfully created.' | |||
format.html { redirect_to home_url } | |||
format.xml { render :xml => @clip, :status => :created, :location => @clip } | |||
else | |||
format.html { render :action => "new" } | |||
format.xml { render :xml => @clip.errors } | |||
end | |||
end | |||
end | |||
|
|||
def find_playlist | |||
@playlist = Playlist.find_by_user_id(current_user.id) | |||
end | |||
|
|||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,50 @@ | |||
class FeaturedClipsController < ApplicationController | |||
before_filter :login_required | |||
before_filter :find_playlist | |||
|
|||
# GET /clips | |||
# GET /clips.xml | |||
def index | |||
@clips = Clip.find_all_by_user_id_and_featured(current_user.id, true) | |||
|
|||
respond_to do |format| | |||
format.html # index.html.erb | |||
format.xml { render :xml => @clips } | |||
end | |||
end | |||
|
|||
# GET /clips/new | |||
# GET /clips/new.xml | |||
def new | |||
@clip = Clip.new | |||
@your_email = "#{current_user.login}@filmprmail.com" | |||
|
|||
respond_to do |format| | |||
format.html # new.html.erb | |||
format.xml { render :xml => @clip } | |||
end | |||
end | |||
|
|||
# POST /clips | |||
# POST /clips.xml | |||
def create | |||
@clip = Clip.new(params[:clip]) | |||
@clip.user_id = current_user.id | |||
|
|||
respond_to do |format| | |||
if @clip.save | |||
flash[:notice] = 'Clip was successfully created.' | |||
format.html { redirect_to home_url } | |||
format.xml { render :xml => @clip, :status => :created, :location => @clip } | |||
else | |||
format.html { render :action => "new" } | |||
format.xml { render :xml => @clip.errors } | |||
end | |||
end | |||
end | |||
|
|||
def find_playlist | |||
@playlist = Playlist.find_by_user_id(current_user.id) | |||
end | |||
|
|||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
class HomesController < ApplicationController | |||
before_filter :login_required | |||
|
|||
# GET /home | |||
def show | |||
@url_for_media_player = | |||
@playlist = Playlist.find_or_create_by_user_id(current_user.id) | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,24 @@ | |||
class PlaylistsController < ApplicationController | |||
|
|||
# GET /clips/1 | |||
# GET /clips/1.xml | |||
def show | |||
@playlist = Playlist.find(params[:id]) | |||
|
|||
respond_to do |format| | |||
format.html # show.html.erb | |||
format.xml { render :xml => @playlist } | |||
end | |||
end | |||
|
|||
# add a clip (:id) to a playlist as a track | |||
# POST /playlist/add/:id | |||
def add | |||
clip = Clip.find(params[:id]) | |||
playlist = Playlist.find_by_user_id(current_user.id) | |||
playlist.tracks << Track.create!(:title => clip.title, :location => clip.location) | |||
flash[:notice] = 'Track was successfully created.' | |||
|
|||
redirect_to clips_url | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
# This controller handles the login/logout function of the site. | |||
class SessionsController < ApplicationController | |||
|
|||
# render new.rhtml | |||
def new | |||
end | |||
|
|||
def create | |||
self.current_user = User.authenticate(params[:login], params[:password]) | |||
if logged_in? | |||
if params[:remember_me] == "1" | |||
self.current_user.remember_me | |||
cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } | |||
end | |||
redirect_back_or_default('/') | |||
flash[:notice] = "Logged in successfully" | |||
else | |||
flash[:warn] = "Error logging in, check your password." | |||
render :action => 'new' | |||
end | |||
end | |||
|
|||
def destroy | |||
self.current_user.forget_me if logged_in? | |||
cookies.delete :auth_token | |||
reset_session | |||
flash[:notice] = "You have been logged out." | |||
redirect_back_or_default('/') | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,85 @@ | |||
class TracksController < ApplicationController | |||
# GET /tracks | |||
# GET /tracks.xml | |||
def index | |||
@tracks = Track.find(:all) | |||
|
|||
respond_to do |format| | |||
format.html # index.html.erb | |||
format.xml { render :xml => @tracks } | |||
end | |||
end | |||
|
|||
# GET /tracks/1 | |||
# GET /tracks/1.xml | |||
def show | |||
@track = Track.find(params[:id]) | |||
|
|||
respond_to do |format| | |||
format.html # show.html.erb | |||
format.xml { render :xml => @track } | |||
end | |||
end | |||
|
|||
# GET /tracks/new | |||
# GET /tracks/new.xml | |||
def new | |||
@track = Track.new | |||
@track.playlist = current_user.playlist | |||
|
|||
respond_to do |format| | |||
format.html # new.html.erb | |||
format.xml { render :xml => @track } | |||
end | |||
end | |||
|
|||
# GET /tracks/1/edit | |||
def edit | |||
@track = Track.find(params[:id]) | |||
end | |||
|
|||
# POST /playlist/1/tracks | |||
def create | |||
@track = Track.new(params[:track]) | |||
|
|||
respond_to do |format| | |||
if @track.save | |||
flash[:notice] = 'Track was successfully created.' | |||
format.html { redirect_to clips_url } | |||
format.xml { render :xml => @track, :status => :created, :location => @track } | |||
else | |||
format.html { render :action => "new" } | |||
format.xml { render :xml => @track.errors } | |||
end | |||
end | |||
end | |||
|
|||
# PUT /tracks/1 | |||
# PUT /tracks/1.xml | |||
def update | |||
@track = Track.find(params[:id]) | |||
|
|||
respond_to do |format| | |||
if @track.update_attributes(params[:track]) | |||
flash[:notice] = 'Track was successfully updated.' | |||
format.html { redirect_to playlist_track_url(@track.playlist.id, @track) } | |||
format.xml { head :ok } | |||
else | |||
format.html { render :action => "edit" } | |||
format.xml { render :xml => @track.errors } | |||
end | |||
end | |||
end | |||
|
|||
# DELETE /tracks/1 | |||
# DELETE /tracks/1.xml | |||
def destroy | |||
@track = Track.find(params[:id]) | |||
@track.destroy | |||
|
|||
respond_to do |format| | |||
format.html { redirect_to(tracks_url) } | |||
format.xml { head :ok } | |||
end | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
class UsersController < ApplicationController | |||
|
|||
# render new.rhtml | |||
def new | |||
end | |||
|
|||
def create | |||
@user = User.new(params[:user]) | |||
@user.save! | |||
self.current_user = @user | |||
redirect_back_or_default('/') | |||
flash[:notice] = "Thanks for signing up!" | |||
rescue ActiveRecord::RecordInvalid | |||
render :action => 'new' | |||
end | |||
|
|||
def activate | |||
self.current_user = User.find_by_activation_code(params[:id]) | |||
if logged_in? && !current_user.activated? | |||
current_user.activate | |||
flash[:notice] = "Signup complete!" | |||
end | |||
redirect_back_or_default('/') | |||
end | |||
|
|||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
# Methods added to this helper will be available to all templates in the application. | |||
module ApplicationHelper | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
module ClipsHelper | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
module FeaturedClipsHelper | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
module HomeHelper | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
module PlaylistsHelper | |||
|
|||
def render_thumbnail(track) | |||
thumb = File.basename(track.location, File.extname(track.location)).concat("_80x80.jpg") | |||
image_tag(File.join("/clips", thumb)) | |||
end | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
module SessionsHelper | |||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
module TracksHelper | |||
end |
Oops, something went wrong.