Skip to content

Commit

Permalink
Add default build configs
Browse files Browse the repository at this point in the history
This offers three configurations by default:
1) everything enabled (including WebM and offline)
2) DASH MP4 VOD only
3) DASH MP4 live only

The VOD and live configs are specifically targetting the most common
scenarios.  For VOD this means SegmentBase, and for live this means
SegmentList and SegmentTemplate.

Issue #116

Change-Id: I250b55c73c4a5f111dccd09bec11bc959ef2d13c
  • Loading branch information
joeyparrish committed Nov 3, 2015
1 parent 1ebf669 commit 19b48e5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@ third_party/closure/goog/deps.js
shaka-player.compiled.js
shaka-player.compiled.debug.js
shaka-player.compiled.debug.map
shaka-player.live.js
shaka-player.live.debug.js
shaka-player.live.debug.map
shaka-player.vod.js
shaka-player.vod.debug.js
shaka-player.vod.debug.map
docs/api
docs/reference
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ but in short, you can build the library by running:
./build/all.sh
```

By default, we create three builds:
* shaka-player.compiled.js (full build)
* shaka-player.vod.js (DASH MP4 VOD content w/ SegmentBase only)
* shaka-player.live.js (DASH MP4 live content w/ Segment{Template,List} only)

You can create custom builds by passing arguments to build/build.sh. See
build/all.sh and build/build.sh for details.

Compiling Shaka Player requires Java JRE 7 or greater, but you can use the
library in uncompiled mode without Java. Just generate the closure
dependencies by running:
Expand Down
18 changes: 17 additions & 1 deletion build/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@
# limitations under the License.

dir=$(dirname $0)/..
. "$dir"/build/lib.sh

set -e

"$dir"/build/gendeps.sh
"$dir"/build/build.sh
"$dir"/build/lint.sh

# Compile once with demo app files so they get checked. Don't keep the output.
(library_sources_0; closure_sources_0) | compile_0 \
$arguments \
--summary_detail_level 3 \
"$dir"/{app,controls,sender,receiver,receiverApp,appUtils}.js \
> /dev/null
# NOTE: --js_output_file /dev/null results in a non-zero return value and
# stops execution of this script.

# Default build, all features enabled
"$dir"/build/build.sh
# MP4 VOD content only, no offline, live, or WebM
"$dir"/build/build.sh vod --disable-http --disable-offline --disable-webm --disable-live
# MP4 live content only, no offline, WebM, or SIDX
"$dir"/build/build.sh live --disable-http --disable-offline --disable-webm --disable-containers
10 changes: 1 addition & 9 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,7 @@ rm -f "$dir"/lib.js{,.map}
rm -f "$dir"/shaka-player.${name}.debug.{js,map}
rm -f "$dir"/shaka-player.${name}.js

# Compile once with app/controls.js so they get checked. Don't keep the output.
(library_sources_0; closure_sources_0) | compile_0 \
$arguments \
--summary_detail_level 3 "$dir"/{app,controls,sender,receiver,receiverApp,appUtils}.js > /dev/null
# NOTE: --js_output_file /dev/null results in a non-zero return value and
# stops execution of this script.

# Compile without app/controls.js and output the minified library only.
# Compile without demo app files and output the minified library only.
# Including shaka-player.uncompiled makes sure that nothing gets stripped which
# should be exported. Otherwise, things unused internally may be seen as dead
# code.
Expand All @@ -90,4 +83,3 @@ cp "$dir"/shaka-player.${name}{.debug,}.js
# locations.
echo "//# sourceMappingURL=shaka-player.${name}.debug.map" >> \
"$dir"/shaka-player.${name}.debug.js

0 comments on commit 19b48e5

Please sign in to comment.