Posts: 876
Name: Matt Pealing
Location: England, north west
|
I've probably worded the title of this completely wrong, but it's the most suitable one I can think of!
Here is the code I'm working with (for jPlayer plugin):
Code:
$(document).ready(function(){
$('.jp-jplayer').jPlayer({
ready: function () {
$(this).jPlayer('setMedia', {
m4v: 'www.someurl.com/video.m4v'
});
},
ended: function (event) {
$(this).jPlayer('play');
}
});
});
What I'm trying to do is modify the code so that instead of m4v: 'www.someurl.com/video.m4v' it uses the value of the following:
Code:
$(this).next('input').val()
I can output this value in an alert statement no problem, but problems arise if I change my loop like so:
Code:
$(this).jPlayer('setMedia', {
m4v: $(this).next('input').val()
});
Does anyone know how I can modify my script so that it gets the urls from hidden input tags? On my page I have several '.jp-jplayer' elements and inside each one is an element similar to the following:
Code:
<input type="hidden" value="www.someurl.com/video.m4v" />
If anyone could help me out that would be great!
|