Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Video and Audio (Retired) Custom Media Players Polishing a Custom Skin

Valerie Smith
Valerie Smith
Courses Plus Student 5,244 Points

in script element features array is getting pulled up as error with sytax error code!

In my script element, the console does not like the array features it says the '[' bracket is 'uncaught syntax error; unexpected token' and none of the edits are showing. Please let me know if I have made any other mistakes!

<script> $('audio,video').mediaelementplayer({ success: function(player, node){ $('#' + node.id + '-mode').html('mode: ' + player.pluginType); }, features['playpause', 'tracks', 'progress'], startLanguage: 'en', translationSelector: true }); </script>


1 Answer

Brendan Whiting
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,703 Points

Line 44 of treehouse-skin.html you need to put a colon after the property name features:

        success: function(player, node){
          $('#' + node.id + '-mode').html('mode: ' + player.pluginType);
        features: ['playpause', 'tracks', 'progress'],
        startLanguage: 'en',
        translationSelector: true

Often the problem isn't where the error message says it is but right before it. I ran your code through jshint (http://jshint.com/) and it gave me much better error messages. The first item here says what the problem is, everything else fixed itself.

Expected ':' and instead saw '['.
5   Expected ':' and instead saw ','.
5   Expected '}' to match '{' from line 1 and instead saw ']'.
6   Expected ')' and instead saw ':'.
6   Missing semicolon.
7   Expected an assignment or function call and instead saw an expression.
7   Missing semicolon.
7   Unrecoverable syntax error. (87% scanned).