Javascript-форум (https://javascript.ru/forum/)
-   Элементы интерфейса (https://javascript.ru/forum/dom-window/)
-   -   dle, music, javascript (https://javascript.ru/forum/dom-window/39206-dle-music-javascript.html)

bycocacola 20.06.2013 12:48

dle, music, javascript
 
<head>
<script type="text/javascript">
$(document).ready(function() {
$('div.playa').live('click', function(){
var this_id = $(this).attr('id');
jwplayer(this_id).setup({
flashplayer: "/design/playerskin/player.swf",
skin: "/design/playerskin/nacht.zip",
file: $(this).attr("rel"),
autostart: true,
volume: 75,
fullscreen: false,
showdigits: false,
height: 24,
width: 175,
allowscriptaccess: "always",
bgcolor: "#000000",
"controlbar.position": "bottom",
events:{
onPlay: function() {
$("object[id^=song]").each(function(index){
if($(this).attr('id') != this_id){
jwplayer($(this).attr('id')).stop();
}
});
}
}
});
});
});
</script>

<style type="text/css">
div.playa, div[id^=song] {
background: url("/design/images/player.png") no-repeat center transparent;
height: 24px;
width: 175px;
margin-left: auto;
margin-right: auto;
}
</style>
</head>


<div id="song{news-id}" class="playa" style="cursor: pointer" rel="[xfvalue_tunescoop_m4a]"> </div>



[xfvalue_tunescoop_m4a] - ссылка на музыку (прямая)

движок сайта dle
в чем ошибка?
не воспроизводит музыку...

skrudjmakdak 20.06.2013 14:10

а код пропустить через спец теги слишком сложно? ну не удобно же читать вашу писанину..

открывайте фаербаг. смотрите что в консоль валится.. мож ошибка какая то?

bycocacola 21.06.2013 15:53


Kvark 21.06.2013 17:23

что то не хорошо с параметрами что подаеш, попробуй прописать путь на файл напрямую:
<div id='my-video'></div>
<script type='text/javascript'>
    jwplayer('my-video').setup({
        file: 'http://content.bitsontherun.com/videos/lWMJeVvV-364767.mp4',
        image: 'http://www.longtailvideo.com/content/images/jw-player/lWMJeVvV-876.jpg',
        width: '640',
        height: '360'
    });
</script>

skrudjmakdak 24.06.2013 16:36

не, я думаю не в путях дело.. он ругается на строчку jwplayer(this_id).setup({
т.е. не известная jwplayer
там либу скорей надо подключить с jwplayer


Часовой пояс GMT +3, время: 11:11.