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

JavaScript Extending the Media Player

Marko Vojvodic
Marko Vojvodic
32,207 Points

Problem with adding mediaelement plugins?

Hi, i have a problem with adding medialement plugins, i follow skip-back example and try to add another plugin but i had stuck. This is a problem i faced: mediaelement-and-player.min.js:34 error building speed TypeError: a.appendTo is not a function

<script src="skip-back/skip-back.min.js"></script> <script src="skip-back/skip-back-i18n.js"></script>

<script src="speed/speed.js"></script>
<script src="speed/speed-i18n.js"></script>

<link href="speed/speed.css" rel="stylesheet">
<link href="skip-back/skip-back.min.css" rel="stylesheet">
<link href="css/main.css" rel="stylesheet">

in body after elemets:

<script> $('video, audio').mediaelementplayer({ features: ['playpause', 'tracks', 'progress', 'skipback', 'speed'], startLanguage: 'en', skipBackInterval: 6, speeds:[{name: 'Slow', value: '0.75'}, {name: 'Normal', value: '1.00'}, {name: 'Fast', value: '1.35'}], defaultSpeed: 0.75 }); </script>

Nicolas Brier
Nicolas Brier
20,442 Points

Hi Marko, did you solve this? I have the same issue using files from http://www.mediaelementjs.com/ but it is working fine with the downloaded demo files. So I had a look on skip-back.min.js and it appears that they are slightly different in the way they create the player markup ( a=document.createElement("div") ) I cannot find any sample code to make it work with the latest version :(