diff options
| author | Sam Potts <me@sampotts.me> | 2017-09-03 14:36:55 +1000 | 
|---|---|---|
| committer | Sam Potts <me@sampotts.me> | 2017-09-03 14:36:55 +1000 | 
| commit | 2bba1f30e28f402ef96b5f5181dd75788b0e25c9 (patch) | |
| tree | 1e40cc57e3a5b62117b5c9b8906c1348d62d90e7 /demo/src/js | |
| parent | 21966654957f59acc7baf40e60beb72a856eca84 (diff) | |
| download | plyr-2bba1f30e28f402ef96b5f5181dd75788b0e25c9.tar.lz plyr-2bba1f30e28f402ef96b5f5181dd75788b0e25c9.tar.xz plyr-2bba1f30e28f402ef96b5f5181dd75788b0e25c9.zip | |
Fixing Vimeo captions, WIP on settings menu, prettier and VS code settings
Diffstat (limited to 'demo/src/js')
| -rw-r--r-- | demo/src/js/main.js | 101 | 
1 files changed, 64 insertions, 37 deletions
| diff --git a/demo/src/js/main.js b/demo/src/js/main.js index 2ff94121..fb84957a 100644 --- a/demo/src/js/main.js +++ b/demo/src/js/main.js @@ -52,7 +52,7 @@          vimeo: 'vimeo'      };      var currentType = window.location.hash.replace('#', ''); -    var historySupport = (window.history && window.history.pushState); +    var historySupport = window.history && window.history.pushState;      // Bind to each button      [].forEach.call(buttons, function(button) { @@ -62,9 +62,13 @@              newSource(type);              if (historySupport) { -                history.pushState({ -                    'type': type -                }, '', '#' + type); +                history.pushState( +                    { +                        type: type +                    }, +                    '', +                    '#' + type +                );              }          });      }); @@ -87,9 +91,13 @@          // Replace current history state          if (currentType in types) { -            history.replaceState({ -                'type': currentType -            }, '', (video ? '' : '#' + currentType)); +            history.replaceState( +                { +                    type: currentType +                }, +                '', +                video ? '' : '#' + currentType +            );          }          // If it's not video, load the source @@ -122,18 +130,28 @@                  player.source({                      type: 'video',                      title: 'View From A Blue Moon', -                    sources: [{ -                        src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4', -                        type: 'video/mp4' -                    }], +                    sources: [ +                        { +                            src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4', +                            type: 'video/mp4' +                        } +                    ],                      poster: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg', -                    tracks: [{ -                        kind: 'captions', -                        label: 'English', -                        srclang: 'en', -                        src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt', -                        default: true -                    }] +                    tracks: [ +                        { +                            kind: 'captions', +                            label: 'English', +                            srclang: 'en', +                            src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt', +                            default: true +                        }, +                        { +                            kind: 'captions', +                            label: 'French', +                            srclang: 'fr', +                            src: 'https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.fr.vtt' +                        } +                    ]                  });                  break; @@ -141,13 +159,16 @@                  player.source({                      type: 'audio',                      title: 'Kishi Bashi – “It All Began With A Burst”', -                    sources: [{ -                        src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3', -                        type: 'audio/mp3' -                    }, { -                        src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg', -                        type: 'audio/ogg' -                    }] +                    sources: [ +                        { +                            src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3', +                            type: 'audio/mp3' +                        }, +                        { +                            src: 'https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg', +                            type: 'audio/ogg' +                        } +                    ]                  });                  break; @@ -155,10 +176,12 @@                  player.source({                      type: 'video',                      title: 'View From A Blue Moon', -                    sources: [{ -                        src: 'https://www.youtube.com/watch?v=bTqVqk7FSmY', -                        type: 'youtube' -                    }] +                    sources: [ +                        { +                            src: 'https://www.youtube.com/watch?v=bTqVqk7FSmY', +                            type: 'youtube' +                        } +                    ]                  });                  break; @@ -166,10 +189,12 @@                  player.source({                      type: 'video',                      title: 'View From A Blue Moon', -                    sources: [{ -                        src: 'https://vimeo.com/76979871', -                        type: 'vimeo' -                    }] +                    sources: [ +                        { +                            src: 'https://vimeo.com/76979871', +                            type: 'vimeo' +                        } +                    ]                  });                  break;          } @@ -198,9 +223,11 @@  if (window.location.host === 'plyr.io') {      (function(i, s, o, g, r, a, m) {          i.GoogleAnalyticsObject = r; -        i[r] = i[r] || function() { -            (i[r].q = i[r].q || []).push(arguments); -        }; +        i[r] = +            i[r] || +            function() { +                (i[r].q = i[r].q || []).push(arguments); +            };          i[r].l = 1 * new Date();          a = s.createElement(o);          m = s.getElementsByTagName(o)[0]; @@ -210,4 +237,4 @@ if (window.location.host === 'plyr.io') {      })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');      window.ga('create', 'UA-40881672-11', 'auto');      window.ga('send', 'pageview'); -}
\ No newline at end of file +} | 
