Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML Extending the Media Player

Daven Hietala
Daven Hietala
8,040 Points

Skipback function not working. File path may be off.

I have downloaded the mediaelement-plugins-master. I created a skip-back file. I linked the skip-back-i18n.js, skip-back.min.css, and the skip-back.min.js file into the skip-back folder. I also linked the skipback.svg file into the css folder.

here are my scripts/links..

    <title>HTML Video and Audio</title>

    <link rel="stylesheet" href="css/normalize.css">
    <link href='http://fonts.googleapis.com/css?family=Nunito:400,300' rel='stylesheet' type='text/css'>
    <script src="js/jquery-3.4.1.min.js"></script>
    <script src="js/mediaelement-and-player.min.js"></script>
    <link href="css/mediaelementplayer.css" rel="stylesheet">
    <script src="skip-back/skip-back.min.js"></script>
    <script src="skip-back/skip-back-i18n.js"></script>
    <script src="skip-back/skipback.svg"></script>
    <link href="css/main.css" rel="stylesheet">
    <link href="skip-back/skip-back.min.css" rel="stylesheet">
    <link href="css/skipback.svg" rel="stylesheet">
  </head>
  <body>

and here is the one at the bottom..

    <script>
      $('video, audio').mediaelementplayer({
        features: ['playpause', 'tracks', 'progress', skipback],
        startLanguage: 'en',
        skipBackInterval: 4
      });
    </script>
  </body>
</html>

There are no controls on my video after I refresh the page with the new code above.

Sidenote.. When I look at the documentation on github, I find it odd that in the features section there is no mention of the 'skipback' feature. i.e. "List of features/plugin to use in the player; some will be included in the control bar (by default IN STRICT ORDER: playpause, current, progress, duration, tracks, volume, fullscreen)"

Here is what the console is telling me in Chrome..

(index):45 Uncaught ReferenceError: skipback is not defined at (index):45

/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found) Navigated to http://port-80-lmds9ndzgq.treehouse-app.com/ (index):17

Resource interpreted as Stylesheet but transferred with MIME type image/svg+xml: "http://port-80-lmds9ndzgq.treehouse-app.com/css/skipback.svg". (index):45 Uncaught ReferenceError: skipback is not defined at (index):45 (anonymous) @ (index):45

Resource interpreted as TextTrack but transferred with MIME type text/plain: "http://port-80-lmds9ndzgq.treehouse-app.com/bridge-captions.vtt". @ (index):1

What am I doing wrong here? Please help!

Daven Hietala

2 Answers

Put skipback in quotes

features: ['playpause', 'tracks', 'progress', 'skipback'],
Daven Hietala
Daven Hietala
8,040 Points

hahahaha! OMG... Thank you kindly