Streaming live audio with jPlayer

后端 未结 1 1023
猫巷女王i
猫巷女王i 2021-02-12 12:21

I am learning how to use jPlayer. I\'d like to stream http://u10.sky.fm:80/sky_the80s audio using jPlayer.

http://www.jplayer.org/1.2.0/demo-08-oggSupportFalse/ demo wor

1条回答
  •  误落风尘
    2021-02-12 12:55

    Two things you could check:

    Is the path to the swf correct?

    Depending on the browser-capabilities jplayer chooses the playback mode (html5/flash). Try using an absolute path for the swf, includeing the file-part - eg:

    swfPath:"/static/swf/jplayer.swf"
    

    and make sure that you can access it, in your case maybe something like: http://www.sky.fm/static/swf/jplayer.swf

    Do you serve the correct MIME Types?

    As written in the Developer Guide you should make sure to propperly set the mimetypes. Not sure if you have an issue there. When checking the mentioned stream with:

    curl http://mp3-a8-128.as34763.net:80/;stream/1 
    

    you get:

    ICY 200 OK
    ...
    content-type:audio/mpeg
    ...
    

    The manual tells that you should set audio/mp4 for m4a. (and audio/mpeg is used for mp3)

    Maybe you could provide your current code with urls to running streams? This would make it easier to figure out what's going on. (The http://u10.sky.fm:80/sky_the80s does not work - at least for me...)

    0 讨论(0)
提交回复
热议问题