Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> API youtube regulacja głosności, api youtube regulacja głośności
asall
post
Post #1





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

Ostrzeżenie: (0%)
-----


  1. <script>function onPlayerStateChange(event) {
  2. event.target.setVolume($("#amount").val());
  3. }
  4.  
  5.  
  6.  
  7. <div id="slider-range-max"></div>
  8. Głos <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;">


Robie skrypcik do filmów youtune walcze z regulacją głośności no i generalnie skrypt działa lecz przy dynamicznej zmianie głośności załącza sie poprawnie pod stop-start filmu

prosze o pomoc
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 7)
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


No, bo podpiąłeś ustawianie głośności na zdarzenie zmiany stanu odtwarzacza.


--------------------
Go to the top of the page
+Quote Post
asall
post
Post #3





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

Ostrzeżenie: (0%)
-----


ahai a to znaczy ?
Go to the top of the page
+Quote Post
trueblue
post
Post #4





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


  1. <script type="text/javascript">
  2. var player=new YT.Player('player', {
  3. playerVars: {
  4. 'autoplay': 1,
  5. 'controls': 1,
  6. 'enablejsapi': 1
  7. },
  8. videoId: 'xxxxxxx'
  9. });
  10.  
  11.  
  12. <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" value="100" onchange="player.setVolume(parseInt(this.value));"/>

player.setVolume możesz wywoływać w innym miejscu, zależy od Ciebie.

Ten post edytował trueblue 31.03.2014, 15:11:14


--------------------
Go to the top of the page
+Quote Post
asall
post
Post #5





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

Ostrzeżenie: (0%)
-----


a jeżeli chce pobrać value z slider UI ?

coś tego typu ?

onmouseover="player.setVolume(parseInt($("#amount").value));"

Ten post edytował asall 31.03.2014, 16:14:22
Go to the top of the page
+Quote Post
trueblue
post
Post #6





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Jeśli można z niego pobrać wartość przez: $("#amount").value to ok.
A jeśli nie, to co to za slider UI? Z jQuery UI?


--------------------
Go to the top of the page
+Quote Post
asall
post
Post #7





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

Ostrzeżenie: (0%)
-----


dokładnie chodzi mi o jquery UI slider
Go to the top of the page
+Quote Post
trueblue
post
Post #8





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


http://api.jqueryui.com/slider/#event-change

  1. $(".selector").slider({
  2. change: function( event, ui ) {
  3. player.setVolume(ui.value);
  4. }
  5. });

Nie wiem na jakim elemencie masz slider, więc ustaw odpowiedni selektor.


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 04:11