A
A
ash_12014-10-18 00:33:06
JavaScript
ash_1, 2014-10-18 00:33:06

Need to deal with jplayer, how to make video quality buttons?

1) You need to make the drop-down variations of the video quality 720 480 360 240 like in VK
. Can this be done through jplayer?

2) it is not very clear in the documentation that if the browser does not support js, then it switches to Flash, for this, connect the swf file, how to connect it, if I have completely different skins (that is, my own), which is not clear for this. Who worked, please explain, but rather give a link to the resource, preferably ru.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Belenkov, 2014-11-04
@IoannGrozny

2) I'll start with the second question. I can't give resources in Russian. But the essence of the work is as follows: if the browser does not support playback using HTML5, then the fallback is pulled to AS. This does not affect the operation of your skins in any way, it only depends on how the browser renders the content itself. All your controls will work, so include the swf file that comes with the plugin and don't think about it anymore.
1) Well, now the first question, the most delicious, so to speak. Briefly, you can. More details:
Step 1. Create the control itself:

<select class='quality'>
    <option value='медиа объект - качество 240'>240</option>
    <option value='медиа объект - качество 360'>360</option>
    <option value='медиа объект - качество 480'>480</option>
    <option value='медиа объект - качество 720'>720</option>
</select>

Step 2. Changing the video quality itself:
// подразумеваю, что переменная player - ваш плеер;
$('.quality').on('change', function() {
    var currentTime = player.data("jPlayer").status.currentTime, //сохраняем текущее время
          media = $(this).val(); // сохраняем значение выбранной опции
    
    player.jPlayer('setMedia', media); // меняем медиа объект;
    player.jPlayer('play', currentTime); // запускаем плеер с того места, где остановилось проигрывание в предыдущем качестве
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question