├── .gitignore ├── tests ├── BeBopAliens.mp3 ├── BeBopAliens.ogg ├── README.md ├── tests.html ├── runner.js ├── tests.js └── .jshintrc ├── screenshots ├── bPlayer_demo_data_0.png ├── bPlayer_demo_data_1.png └── bPlayer_demo_data_no.png ├── css └── bootstrap3_player.css ├── CHANGES.md ├── README.md ├── index.html ├── js ├── .jshintrc └── bootstrap3_player.js └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | *.sublime-workspace 2 | *.sublime-project 3 | .DS_Store 4 | *~ 5 | js/node_modules/ 6 | -------------------------------------------------------------------------------- /tests/BeBopAliens.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iainhouston/bootstrap3_player/HEAD/tests/BeBopAliens.mp3 -------------------------------------------------------------------------------- /tests/BeBopAliens.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iainhouston/bootstrap3_player/HEAD/tests/BeBopAliens.ogg -------------------------------------------------------------------------------- /screenshots/bPlayer_demo_data_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iainhouston/bootstrap3_player/HEAD/screenshots/bPlayer_demo_data_0.png -------------------------------------------------------------------------------- /screenshots/bPlayer_demo_data_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iainhouston/bootstrap3_player/HEAD/screenshots/bPlayer_demo_data_1.png -------------------------------------------------------------------------------- /screenshots/bPlayer_demo_data_no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iainhouston/bootstrap3_player/HEAD/screenshots/bPlayer_demo_data_no.png -------------------------------------------------------------------------------- /tests/README.md: -------------------------------------------------------------------------------- 1 | Testing notes: 2 | ----------- 3 | 4 | - ~~Run tests in ECMAScript 6-compatible browser e.g. Firefox 34 or later~~ Tests run in Moz and WebKit browsers. There were significant differences seen in the behaviour of asynchronous actions. Tests refactored to avoid these differences. 5 | - [FuncUnit testing library](http://funcunit.com/index.html) is used for Functional Tests with waits for asynchrous events e.g. round trip from mute button -> audio element action -> event listener on volume slider etc. 6 | - FuncUnit adds to [QUnit](http://api.qunitjs.com/)'s more basic async support. 7 | - Not all real User interactions behave the same as FuncUnit actions. Clicking the play button, for example, doesn't have exactly the same effect in both cases. 8 | - Even so. We can build a suite of tests sufficient to satisfy ourselves that the styling changes we made did not adversely impact the Javascript functionality. 9 | - Don't test include player html in `#qunit-fixture` when running FuncUnit tests. i.e. Our test script consists of just one Functional Test with FuncUnit vs lots of atomic Unit Tests with QUnit. 10 | - The test files BeBopAliens.ogg and BeBopAliens.mp3 are my original work and available to you under [Creative Commens Licence 0](http://creativecommons.org/about/cc0) 11 | -------------------------------------------------------------------------------- /css/bootstrap3_player.css: -------------------------------------------------------------------------------- 1 | .playa input[type="range"] { 2 | background-color: #ddd; 3 | border: 1px solid #bbb; 4 | border-radius: 0.5em; 5 | opacity: 0.5; 6 | height: 1em; 7 | top: 2px; 8 | position: relative; 9 | } 10 | 11 | .playa .thumbnail { 12 | width:100%; 13 | } 14 | 15 | /* sliders and buttons need a uniform height */ 16 | .playa .btn-group .btn { 17 | display:inline-block; 18 | float:none; 19 | height: 2.2em; 20 | } 21 | 22 | /* contains the attribution link */ 23 | .playa .row:nth-child(4) { 24 | overflow: hidden; 25 | } 26 | 27 | /* Acknowledgements: 28 | To Glyphicons (http://glyphicons.com/) for the Halflings glyphs font */ 29 | 30 | /* .spin is used to rotate glyphicon glyphicon-refresh */ 31 | .spin { 32 | -webkit-animation: spin 2s infinite linear; 33 | -moz-animation: spin 2s infinite linear; 34 | -o-animation: spin 2s infinite linear; 35 | animation: spin 2s infinite linear; 36 | } 37 | 38 | @-moz-keyframes spin { 39 | from { 40 | -moz-transform: rotate(0deg); 41 | } 42 | to { 43 | -moz-transform: rotate(360deg); 44 | } 45 | } 46 | 47 | @-webkit-keyframes spin { 48 | from { 49 | -webkit-transform: rotate(0deg); 50 | } 51 | to { 52 | -webkit-transform: rotate(360deg); 53 | } 54 | } 55 | 56 | @keyframes spin { 57 | from { 58 | transform: rotate(0deg); 59 | } 60 | to { 61 | transform: rotate(360deg); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tests/tests.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | QUnit test bootstrap3_player 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | ### Main differences between `bootstrap-player` and `bootstrap3_player` 2 | 3 | #### Reduced dependencies 4 | 5 | - `html5slider.js` no longer required since Firefox 23 (it's now at 34 at this time of writing) 6 | - Font Awesome no longer required thanks to [Glyphicons](http://glyphicons.com/) for the Halflings glyphs font that comes free of cost with Bootstrap 3 7 | 8 | #### CSS differences 9 | 10 | - Reduced custom css: greater reliance on Bootstrap 3 component styling; particularly buttons and button groups. 11 | - Bootstrap 3 classes replace many Bootstrap 2 classes. Notably: 12 | - `span*` => `col-sm-*` 13 | - `.disabled` => opaque property on `input[type="range"]`. 14 | (`.disabled` disables the sliders as well as styling them opaquely) 15 | - `.icon-spin` => `glyphicon glyphicon-refresh spin` 16 | - `collapsing` introduced 17 | - `.spin` class introduced to apply rotation keyframes to `glyphicon-refresh` 18 | - seek and volume slider controls hidden on xs viewports. This is not entirely satisfactory as the controls are jumbled when the player's container is styled narrow on the web page rather than just being viewed on a narrow device. 19 | 20 | #### Javascript differences 21 | 22 | - Functionality of William Randol's [bootstrap-player](https://github.com/WilliamRandol/bootstrap-player) not changed 23 | - Changes only made to incorporate [CSS Differences](#cdiff) 24 | - Program statements indented per jslint / jshint for future readers 25 | - A very few comments added for the benefit of future readers 26 | 27 | #### Live demo 28 | 29 | - Bootstrap 3 grid classes: 30 | - absolutely addressed links to external files used in the demo 31 | - redundant css and js links removed 32 | - `index.html` is all the "how to" documenntation really required. Please raise an issue if I am wrong. 33 | 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | bootstrap3_player 2 | ================ 3 | 4 | An HTML5 Audio Player Skin For Twitter Bootstrap 3 5 | 6 | #### Requires: 7 | 8 | * Twitter Bootstrap 3 - http://twitter.github.com/bootstrap/ 9 | * jQuery - http://jquery.com/ 10 | 11 | #### How to use 12 | 13 | Clone or download this repo; then open the included [`index.html`](index.html) file: 14 | - with **your browser** to: 15 | - see a live demo on your local machine 16 | - compare it with the [screenshots or live demo](#screenshots) below 17 | - with your [text editor](index.html) to: 18 | - see all the css and js files you need to link to 19 | - see the `