Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
Better scripts, working integration tests, and readme improvements:
Browse files Browse the repository at this point in the history
- Use bin-debug as the location for all project-only testing.  Killed off bin-release, as it didn't make a lot of sense to have this as well.
- Removed setup.sh, which isn't really needed now that Video.js isn't being pulled in to video-js-swf.  The part of setup.sh that's still needed was pulled into the README.
- Change build.sh to copy a Flash-specific test file and the latest SWF into video.js/dist
- Change test.sh to try to run both the unit and integration tests
- Fix the main integration test file to point to the right swfobject.js file, a fix that Jim W really found
- bin-debug now has a testing file, index_full.html, which was developed previously for testing the video-js-swf project.  It's a pretty nice way to do all sorts of sanity checks without bringing in any of the main video.js project.
- bin-debug also now has a second testing file, index.html, which is a stripped-down version of index_full.html.  I created this version so that you don't have to click on four buttons to see a video play.  It also really simplifies the wording on the page so that it's just focused on video playback.
  • Loading branch information
Brian Deitte committed Jul 22, 2013
1 parent 074e7e7 commit 5c77221
Show file tree
Hide file tree
Showing 14 changed files with 1,147 additions and 79 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
test/*
bin-release
bin-debug
*.iml
*.iml
bin-debug/VideoJS.swf

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ git pull upstream master

4. Create a new branch for your work, and make your changes.

5. Thoroughly test your feature or fix. In addition to new unit tests, and testing the area(s) specific to the area you're working on, a brief smoketest of the player never hurts. We'd like to suggest this short smoke test with both FLV and MP4 video formats:
5. Thoroughly test your feature or fix. See the guide for running the unit and integration tests in the README. Adding new tests is both highly encouraged and appreciated. In addition to the automated tests, and testing the area(s) specific to the area you're working on, a brief smoketest of the player never hurts. We'd like to suggest this short smoke test with both FLV and MP4 video formats:
1. Playback should start after clicking Play overlay
2. Playback should start after clicking Play button
3. Playback should pause when clicking the Pause button
Expand All @@ -40,7 +40,7 @@ git pull upstream master

(This may seem like a lot of steps, but they could all be accomplished with a couple of short-duration test files, within a few minutes.)

6. After committing your changes to your fork of the repo, submit your [Pull Request](#pull-requests).
6. After committing your changes to your fork of the repo, submit your [Pull Request](#pull-requests). If you are changing the source code, make sure to submit a second pull request to the main Video.js repo. This must be done to change the copy of video-js.swf that Video.js uses. When you run build.sh, video-js.swf is always updated to contain the latest changes you have in video-js-swf.

##Filing Bugs

Expand Down Expand Up @@ -76,7 +76,7 @@ Here's an example:

Chrome 21+ (as of 2013/01/01) doens't run Flash files that are local and loaded into a locally accessed page (file:///). To get around this you can do either of the following:

1. Do your development and testing using a local HTTP server.
1. Do your development and testing using a local HTTP server. See the README for instructions on using simple-http-server for this purpose.
2. Disable the version of Flash included with Chrome and enable a system-wide version of Flash instead.

Other Video.js Projects
Expand Down
48 changes: 22 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,60 @@ This project doesn't need to be used if you simply want to use the Flash video p
Installation
============

1. Go through the Getting started section for [Video.js](https://github.com/videojs/video.js/blob/master/CONTRIBUTING.md). Most importantly, you will need have already built video.js successfully before building video-js-swf.
1. Go through the Getting started section for [Video.js](https://github.com/videojs/video.js/blob/master/CONTRIBUTING.md). Most importantly, you will need have already built Video.js successfully before building video-js-swf.

2. Install [Apache Flex](http://flex.apache.org/installer.html). There's no need to install any of the optional items.

3. In the base directory of video-js-swf, you'll see a setup.sh script. Make sure to include the path to Video.js and Flex SDK as arguments to the script.
3. You'll need the Flash Player 10.3 library to compile. Run the commands below to get them installed.

```bash
./setup.sh [video_js_dir] [flex_sdk_dir]
```bash
export FLEX_HOME=[flex_home]
mkdir -p "$FLEX_HOME/frameworks/libs/player/10.3"
curl --silent -o "$FLEX_HOME/frameworks/libs/player/10.3/playerglobal.swc" "http://fpdownload.macromedia.com/get/flashplayer/updaters/10/playerglobal10_3.swc"
```
This script will do the following:
- Create a new directory in your Flex SDK for playerglobal10_3.swc, and download this file.
- Set up the bin-debug and bin-release directories.
.

4. Install a simple HTTP server for simpler testing.

```bash
npm -g install simple-http-server
```

5. Build video-js.swf using build.sh. Make sure to include the path to the Flex SDK as an argument to the script.
5. Build the SWF using build.sh. Make sure to include the paths to Video.js and the Flex SDK as arguments to the script.

```bash
./build.sh [video_js_dir] [flex_sdk_dir]
```

This script will do the following:
- Compile the source into bin-release using the release compiler settings.
- Copy the SWF into [video.js]/src/swf/video-js.swf

7. Start running the simple HTTP server from the command-line.
7. Start running the simple HTTP server from the command-line in the video-js-swf root directory.

```bash
nserver
```

Now you can see the demo working with your newly-built code:
Start the simple HTTP server in the video-js-swf root directory, and open your browser at [http://localhost:8000/bin-release/demo.html]

You can keep using build.sh to rebuild the Flash code.
8. Open your browser at [http://localhost:8000/bin-debug/index.html] to see a video play. You can keep using build.sh to rebuild the Flash code.

Using with Your IDE
============

The bin-debug directory is set up for usage with your IDE

If you don't want to keep using build.sh to build the code, the bin-debug directory is set up for use with your IDE. It is similar to the bin-release directory, except that the SWF name is expected to be VideoJS.swf. This works better with some IDEs that expect the SWF name to be the same as the main class name.
If you don't want to keep using build.sh to build the code, you don't have to. The bin-debug directory is set up for usage with your IDE.

You can also use the given .actionscriptProperties with Flash Builder. It is set up to use bin-debug and generally ready to use. When you want to run the project, set the output URL to http://localhost:8000/bin-release/demo.html. As long as nserver is running, you should get the latest code you compile there.
You can use the given .actionscriptProperties with Flash Builder. It is set up to use bin-debug and generally ready to use. When you want to run the project, set the output URL to http://localhost:8000/bin-debug/index.html. As long as nserver is running, you should get the latest code you compile there.

Running Unit Tests
Running Unit and Integration Tests
===========

This project uses FlexUnit which is built into [Adobe FlashBuilder](ihttp://www.adobe.com/products/flash-builder.html) and is also available on [GitHub](https://github.com/flexunit/flexunit) if you are only interested in the binaries.
For unit tests, this project uses FlexUnit. FlexUnit is built into [Adobe FlashBuilder](ihttp://www.adobe.com/products/flash-builder.html) and is also available on [GitHub](https://github.com/flexunit/flexunit) if you are only interested in the binaries.

The unit tests can be found in [project root]/src/com/videojs/test/

In order to run the tests:
For integration tests, this project uses [qunit](http://qunitjs.com/).

The integration tests can be found in [project root]/test

In order to run all of the tests:

```bash
./test.sh
```

A copy of the produced swf will also be compiled into the bin-debug folder.
A copy of the SWF produced for the unit tests will be compiled into the bin-debug folder. Both the unit and integration tests will attempt to run with the 'open' command, or an instruction will be given on how to run them manually.
48 changes: 48 additions & 0 deletions bin-debug/css/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
Loading

0 comments on commit 5c77221

Please sign in to comment.