aFarkas/jMediaelement — Issue #17: Calling jQuery UI's slider() method may conflict with other libraries such as jQuery Mobile
Author: mderting
Created: 2012-01-15 19:14:45+00:00
State: open

Hi Alexander,

I did some more investigation regarding jme2 compatibility with jQuery Mobile that we spoke about. The issue is that jQuery Mobile includes it's own slider plugin who's calling method's name (i.e. `$('input').slider();` ) collides with jQuery UI.

See [jQuery Mobile Slider Documentation](http://jquerymobile.com/demos/1.0/docs/forms/slider/index.html)

To work around this, I aliased the jQuery UI slider within `jme.js`:

```javascript

/* Alias jQuery UI slider to avoid conflicts with other libraries (i.e. jQuery Mobile). */
jQuery.fn.uislider = jQuery.fn.slider;

```

Then I modified all the calls to the `slider` method with `uislider`. Example:

```javascript

control.uislider({
range: 'min',
max: duration || 1,
disabled: !duration,
step: 0.1,
value: media.prop('currentTime'),
slide: function(e, data){
if(e.originalEvent){
time.set(data.value);
}
}
});

```

What do you think of this approach?

Let me know if you want me to commit my updates.

Cheers,
Matt