mirror of
				https://github.com/videojs/video.js.git
				synced 2025-10-31 00:08:01 +02:00 
			
		
		
		
	Added line to feature list for Fullscreen edit pull request.
Added require.js for including individual source files during development.
This commit is contained in:
		| @@ -1,3 +1,4 @@ | ||||
| * Added a check for if Firefox is enabled which fixes a Firefox 9 issue | ||||
| * Stopped spinner from showing on 'stalled' events since browsers sometimes don't show that they've recovered. | ||||
| * Fixed CDN Version which was breaking dev.html | ||||
| * Made full-window mode more independent | ||||
|   | ||||
							
								
								
									
										229
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										229
									
								
								Rakefile
									
									
									
									
									
								
							| @@ -4,11 +4,6 @@ require 'httparty' | ||||
|  | ||||
| namespace :build do | ||||
|  | ||||
|   task :test do | ||||
|     Rake::Log['CDN_VERSION = false'.gsub('CDN_VERSION = false', 'hi')] | ||||
|      | ||||
|   end | ||||
|  | ||||
|   desc "Build version for current '/c/' CDN copy and locked in version" | ||||
|   task :current do | ||||
|     Rake::Task["build:source"].execute | ||||
| @@ -58,7 +53,7 @@ namespace :build do | ||||
|     if File.exist?("dist") | ||||
|       Rake::Shell["rm -r dist"] | ||||
|     end | ||||
|      | ||||
|  | ||||
|     # Make distribution folder | ||||
|     Rake::Shell["mkdir dist"] | ||||
|  | ||||
| @@ -107,9 +102,39 @@ namespace :build do | ||||
|     Rake::Log["Minimizing CSS"] | ||||
|     Rake::Shell["java -jar build/lib/yuicompressor-2.4.7.jar dist/video-js.css -o dist/video-js.min.css"] | ||||
|  | ||||
|     Rake::Log[version_number << " Built"]     | ||||
|     Rake::Log[version_number << " Built"] | ||||
|   end | ||||
|  | ||||
|   desc "Build list of source files for easy inclusion in projects" | ||||
|   task :js_source do | ||||
|  | ||||
|     File.open("dev/source-list.js", "w+") do |file| | ||||
|       file.puts "var vjsSourceList = [];" | ||||
|  | ||||
|       src_array = ["src/core", "src/lib"] | ||||
|       last = ["flash/swfobject", "src/setup"] | ||||
|       exclude = [".", "..", ".DS_Store", "_end.js", "_begin.js"] | ||||
|  | ||||
|       Dir.foreach('src') do |item| | ||||
|         next if exclude.include? item | ||||
|  | ||||
|         item_name = "src/" << item.sub(".js", "") | ||||
|  | ||||
|         next if (src_array + last).include? item_name | ||||
|  | ||||
|         src_array << item_name | ||||
|       end | ||||
|  | ||||
|       src_array = src_array + last | ||||
|  | ||||
|       src_array.each do |item| | ||||
|         file.puts "vjsSourceList.push('#{item}')" | ||||
|       end | ||||
|       # file.puts "vjsSourceList.push('src/#{item.sub(".js", "")}')" | ||||
|       # file.puts "vjsSourceList.push('flash/swfobject.js')" | ||||
|  | ||||
|     end | ||||
|   end | ||||
|  | ||||
| end | ||||
|  | ||||
| @@ -121,196 +146,6 @@ def version_number | ||||
|   "#{version['major']}.#{version['minor']}.#{version['patch']}" | ||||
| end | ||||
|  | ||||
| desc "Set up the environment" | ||||
| task :setup do | ||||
|   Rake::Log["Installing jekyll"] | ||||
|   Rake::Shell["gem install jekyll"] | ||||
|   Rake::Log["Installing the RDiscount gem for decent Markdown support"] | ||||
|   Rake::Shell["gem install rdiscount"] | ||||
|   Rake::Log["Installing Pygments for syntax highlighting"] | ||||
|   Rake::Shell["easy_install pygments"] | ||||
|   if !File.exist?("_config.yml") | ||||
|     Rake::Log["Setting up _config.yml"] | ||||
|     Rake::Shell["cp _config.yml.example _config.yml"] | ||||
|   end | ||||
|   Rake::Log["SSH configuration should go in ~/.ssh/config:\n\nHost static1\n  Hostname static1.zencoder.com\n  Port 22777\n  User deploy\n\nHost static2\n  Hostname static2.zencoder.com\n  Port 22777\n  User deploy"] | ||||
|  | ||||
|   Rake::Log["!!! SYNTAX HIGHLIGHTING WIHT PYGMENTS REQUIRED liquid version 2.2.2"] | ||||
|   Rake::Log["gem list -d liquid"] | ||||
|   Rake::Log["If not 2.2.2"] | ||||
|   Rake::Log["gem uninstall liquid"] | ||||
|   Rake::Log['gem install liquid --version "2.2.2"'] | ||||
| end | ||||
|  | ||||
| namespace :site do | ||||
|   desc "Delete site cache" | ||||
|   task :delete do | ||||
|     Rake::Log["Deleting site cache"] | ||||
|     if File.exist?("_site") | ||||
|       Rake::Shell["rm -r _site"] | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   desc "Build the site cache" | ||||
|   task :build do | ||||
|     Rake::Log["Building site cache"] | ||||
|     Rake::Shell["jekyll --no-server --no-auto"] | ||||
|   end | ||||
|  | ||||
|   desc "Rebuild the site cache" | ||||
|   task :rebuild do | ||||
|     Rake::Task["site:delete"].execute | ||||
|     Rake::Task["site:build"].execute | ||||
|   end | ||||
|  | ||||
| end | ||||
|  | ||||
| # Using the HTML5 Boilerplate build script to optimize files | ||||
| namespace :hb do | ||||
|  | ||||
|   desc "Udate H5BP Page List config property" | ||||
|   task :update do | ||||
|     Rake::Log["Updating H5BP Page List (_site/build/config/project.properties)"] | ||||
|     text = File.read("_site/build/config/project.properties") | ||||
|     pages = File.read("_site/page-list-for-h5bp.html") | ||||
|     File.open("_site/build/config/project.properties", "w") do |file| | ||||
|       file.puts text.gsub(/file\.pages\s+=.*/, "file.pages = " << pages) | ||||
|     end | ||||
|   end | ||||
|  | ||||
|   desc "Optimize the site cache using the HTML5 Boilerplate build script. Creates a new folder called 'publish' inside _site folder" | ||||
|   task :build do | ||||
|     Rake::Task["hb:update"].execute | ||||
|  | ||||
|     Rake::Log["Optimizing site cache"] | ||||
|     Rake::Shell["cd _site/build/ && ant build && cd ../.."] | ||||
|   end | ||||
| end | ||||
|  | ||||
|  | ||||
| namespace :env do | ||||
|   desc "Change to development environment" | ||||
|   task :development do | ||||
|     Rake::Log["Changing to development environment"] | ||||
|     set_env_to :development | ||||
|   end | ||||
|  | ||||
|   desc "Change to staging environment" | ||||
|   task :staging do | ||||
|     Rake::Log["Changing to staging environment"] | ||||
|     set_env_to :staging | ||||
|   end | ||||
|  | ||||
|   desc "Change to production environment" | ||||
|   task :production do | ||||
|     Rake::Log["Changing to production environment"] | ||||
|     set_env_to :production | ||||
|   end | ||||
| end | ||||
|  | ||||
| namespace :deploy do | ||||
|   task :update_local do | ||||
|     Rake::Log["Updating local git repo and pushing changes"] | ||||
|     Rake::Shell["git pull && git push"] | ||||
|   end | ||||
|  | ||||
|   desc "Deploy to staging" | ||||
|   task :staging do | ||||
|     Rake::Task["deploy:update_local"].execute | ||||
|     Rake::Log["Rebuilding for staging"] | ||||
|     Rake::Task["env:staging"].execute | ||||
|     Rake::Task["site:rebuild"].execute | ||||
|     Rake::Task["hb:build"].execute | ||||
|     config["servers"]["staging"].each do |server| | ||||
|       Rake::Log["Deploying to #{server.split(':').first}"] | ||||
|       Rake::Shell["rsync -avrzth --delete _site/publish/ #{server}"] | ||||
|     end | ||||
|     Rake::Log["Rebuilding for development"] | ||||
|     Rake::Task["env:development"].execute | ||||
|     Rake::Task["site:rebuild"].execute | ||||
|   end | ||||
|  | ||||
|   desc "Deploy to production" | ||||
|   task :production do | ||||
|     Rake::Task["deploy:update_local"].execute | ||||
|     Rake::Log["Rebuilding for production"] | ||||
|     Rake::Task["env:production"].execute | ||||
|     Rake::Task["site:rebuild"].execute | ||||
|     Rake::Task["hb:build"].execute | ||||
|     config["servers"]["production"].each do |server| | ||||
|       Rake::Log["Deploying to #{server.split(':').first}"] | ||||
|       Rake::Shell["rsync -avrzth --delete _site/publish/ #{server}"] | ||||
|     end | ||||
|     Rake::Log["Rebuilding for development"] | ||||
|     Rake::Task["env:development"].execute | ||||
|     Rake::Task["site:rebuild"].execute | ||||
|   end | ||||
| end | ||||
|  | ||||
| namespace :docs do | ||||
|  | ||||
|   desc "Generate Doc directories and pages from VideoJS library docs" | ||||
|   task :generate do | ||||
|  | ||||
|     Rake::Log["Getting docs from " << config["videojs_dir"]] | ||||
|  | ||||
|     if File.exist?("docs") | ||||
|       Rake::Shell["rm -r docs"] | ||||
|     end | ||||
|     Dir.mkdir("docs"); | ||||
|  | ||||
|     list = "<ul><li id='docs_nav_start'><a href='/docs/'>Start</a></li>\n" | ||||
|     list << "<ul><li id='docs_nav_setup'><a href='/docs/setup/'>Setup</a></li>\n" | ||||
|     list << "<ul><li id='docs_nav_options'><a href='/docs/options/'>Options</a></li>\n" | ||||
|  | ||||
|     Dir.foreach(config["videojs_dir"] << '/docs') do |item| | ||||
|       next if item == '.' or item == '..' | ||||
|  | ||||
|       # do work on real items | ||||
|       Rake::Log[item] | ||||
|  | ||||
|       text = File.read(config["videojs_dir"] << "/docs/" << item) | ||||
|       name = item.gsub(/\.md/, "") | ||||
|  | ||||
|       if name == 'index' | ||||
|         filename = "docs/" << "index.md" | ||||
|         File.open(filename, "w+") do |file| | ||||
|           file.puts "" << text | ||||
|         end | ||||
|       else | ||||
|         filename = "docs/" << name << "/index.md" | ||||
|         Dir.mkdir("docs/" << name) | ||||
|         if name != "glossary" and name != "setup" and name != "options" | ||||
|           list << "<li id='docs_nav_#{name}'><a href='/docs/#{name}/'>#{name}</a></li>\n" | ||||
|         end | ||||
|       end | ||||
|  | ||||
|       File.open(filename, "w+") do |file| | ||||
|         file.puts "" << text | ||||
|       end | ||||
|  | ||||
|     end | ||||
|  | ||||
|     File.open("_includes/docs_menu.html", "w+") do |file| | ||||
|       file.puts list << "<li id='docs_nav_glossary'><a href='/docs/glossary/'>glossary</a></li></ul>" | ||||
|     end | ||||
|   end | ||||
|  | ||||
| end | ||||
|  | ||||
|  | ||||
| def set_env_to(env) | ||||
|   text = File.read("_config.yml") | ||||
|   File.open("_config.yml", "w") do |file| | ||||
|     file.puts text.gsub(/env:.*/, "env: #{env}") | ||||
|   end | ||||
| end | ||||
|  | ||||
| def config | ||||
|   YAML.load(File.read("_config.yml")) | ||||
| end | ||||
|  | ||||
|  | ||||
| module Rake | ||||
|   class Shell | ||||
|     def self.[](command) | ||||
|   | ||||
| @@ -3,10 +3,10 @@ | ||||
| <head> | ||||
|   <title>Video.js | HTML5 Video Player</title> | ||||
|  | ||||
|   <link href="video-js.css" rel="stylesheet" type="text/css"> | ||||
|   <link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet" type="text/css"> | ||||
|  | ||||
|   <!-- video.js must be in the <head> for older IEs to work. --> | ||||
|   <script src="video.js"></script> | ||||
|   <script src="http://vjs.zencdn.net/c/video.js"></script> | ||||
|  | ||||
| </head> | ||||
| <body> | ||||
|   | ||||
							
								
								
									
										31
									
								
								dev/require-list.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								dev/require-list.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| // Attempting to create a portable script that loads source files in order. So we can change which files are included and have it change multiple places. | ||||
| var vjsSourceList = ["require", | ||||
|   'order!../../src/core.js', | ||||
|   'order!../../src/lib.js', | ||||
|   'order!../../src/component.js', | ||||
|   'order!../../src/controls.js', | ||||
|   'order!../../src/ecma.js', | ||||
|   'order!../../src/events.js', | ||||
|   'order!../../src/json.js', | ||||
|   'order!../../src/player.js', | ||||
|   'order!../../src/tech.js', | ||||
|   'order!../../src/tracks.js', | ||||
|   'order!../../flash/swfobject.js', | ||||
|   'order!../../src/setup.js' | ||||
| ]; | ||||
|  | ||||
| // Not going to be used in production, so eval ok. | ||||
| require([vjsSourceList]) | ||||
|  | ||||
| // var requireEval = ''; | ||||
| // for (var i=0; i < vjsSourceList.length; i++) { | ||||
| //   requireEval += 'require(["order!'+vjsSourceList[i]+'"], function() { '; | ||||
| // } | ||||
| //  | ||||
| // requireEval += 'var libsLoaded = true;' | ||||
| //  | ||||
| // for (var i=0; i < vjsSourceList.length; i++) { | ||||
| //   requireEval += ' }); '; | ||||
| // } | ||||
| //  | ||||
| // eval(requireEval); | ||||
							
								
								
									
										2144
									
								
								dev/require.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2144
									
								
								dev/require.js
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -1,13 +1,13 @@ | ||||
| var vjsSourceList = []; | ||||
| vjsSourceList.push('_begin.js') | ||||
| vjsSourceList.push('_end.js') | ||||
| vjsSourceList.push('component.js') | ||||
| vjsSourceList.push('controls.js') | ||||
| vjsSourceList.push('core.js') | ||||
| vjsSourceList.push('ecma.js') | ||||
| vjsSourceList.push('events.js') | ||||
| vjsSourceList.push('json.js') | ||||
| vjsSourceList.push('lib.js') | ||||
| vjsSourceList.push('player.js') | ||||
| vjsSourceList.push('tech.js') | ||||
| vjsSourceList.push('tracks.js') | ||||
| vjsSourceList.push('src/core') | ||||
| vjsSourceList.push('src/lib') | ||||
| vjsSourceList.push('src/component') | ||||
| vjsSourceList.push('src/controls') | ||||
| vjsSourceList.push('src/ecma') | ||||
| vjsSourceList.push('src/events') | ||||
| vjsSourceList.push('src/json') | ||||
| vjsSourceList.push('src/player') | ||||
| vjsSourceList.push('src/tech') | ||||
| vjsSourceList.push('src/tracks') | ||||
| vjsSourceList.push('flash/swfobject') | ||||
| vjsSourceList.push('src/setup') | ||||
|   | ||||
							
								
								
									
										1
									
								
								source-list.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								source-list.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| var vjsSourceList = []; | ||||
		Reference in New Issue
	
	Block a user