jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

RTMP file src HELP @_@!! #182

Open rliriano opened 10 years ago

rliriano commented 10 years ago

How can I play a audio file from a rtmp source like so: rtmp://cp26114.edgefcs.net/ondemand/folder/folder/folder/folder/folder/folder/filename.flv

Do I need to add anything to the JplayerRtmp.as?

Any help would be awesome.

Thanks

happyworm commented 10 years ago

Does this help? http://jplayer.org/latest/demo-01-video-supplied-rtmpv/

rliriano commented 10 years ago

This is my code now:

         (function($){
            $(document).ready(function(){

                new jPlayerPlaylist({
                   jPlayer: ".jp-player",
                   cssSelectorAncestor: ".jp-container"
                   }, [{
                                  title:"Song Title",
                          rtmpa:"rtmp://cp26115.edgefcs.net/ondemand/mpub/mps/catalog_95/000/000/044/asset_118/Beneath_Dead_Leaves.flv",
},], {
                   swfPath: "/js/Jplayer.swf",
                   solution: "html, flash",
                   preload: "auto",
                   supplied: "rtmpa",
                           wmode: "transparent",
                   volume: 0.9,
                   smoothPlayBar: true,
                   keyEnabled: true,
                   verticalVolume: false,cssSelector: {
                       gui: ".jp-gui",
                       play: ".jp-play",
                       pause: ".jp-pause",
                       seekBar: ".jp-seek-bar",
                       volumeBar: ".jp-volume-bar",
                       volumeBarValue: ".jp-volume-bar-value",
                       currentTime: ".jp-current-time",
                       duration: ".jp-duration",
                       gui: ".jp-gui",
                       noSolution: ".jp-no-solution"
                    },
                    errorAlerts: true,
                    warningAlerts: true
                });

            });
         })(jQuery)                 

There isn't any errors on the page but the player wont play the track.

happyworm commented 10 years ago

Support requests are usually handled on the jPlayer Google Group A link to your project also helps us review and look for problems.

In general, your code looks ok... I have not tried using class selectors with the playlist object, but that should not matter.

Have you been able to get the single player working with your rtmp url?

rliriano commented 10 years ago

Yes Ive used the single player and it still doesn't play

rliriano commented 10 years ago

and this is my player build:

<div class="jp-player"></div>
<div class="jp-container">
    <div class="jp-gui">
        <div class="jp-volume-bar">
            <div class="jp-volume-bar-value"></div>
        </div>
        <ul class="jp-controls">
            <li><a href="" class="jp-previous">A</a></li>
            <li><a href="" class="jp-play">C</a></li>
            <li><a href="" class="jp-pause">c</a></li>
            <li><a href="" class="jp-next">B</a></li>
        </ul>
        <div class="jp-progress">
            <div class="jp-seek-bar">
                <div class="jp-play-bar"></div>
            </div>
        </div>
        <div class="jp-time">
            <div class="jp-current-time">00:00</div>
            <div class="jp-duration">00:00</div>
        </div>
    </div>
    <div class="jp-playlist">
        <ul></ul>
    </div>
   <div class="jp-no-solution">
         <span>Update Required</span> To play the media you will need to either update your browser to a recent version or update your <a href="http://get.adobe.com/flashplayer/" target="_blank">Flash plugin</a>.
   </div>
</div>
happyworm commented 10 years ago

Oh... Does your RTMP / FLV stream have metadata in it? jPlayer Known Issues: Flash and m4a/m4v/flv Metadata

I made a mock up using your URL on my system and replicated your problem... I see the Flash try and play it and the timeupdate events being generated, but it never plays.

happyworm commented 10 years ago

Another clue is that the duration does not update, which is a sign that the metadata is not being found... But the loadedmetadata event occurring contradicts that.

rliriano commented 10 years ago

How can I add the event to see the metadata to my code?

happyworm commented 10 years ago

One way would be to add the jPlayer inspector and then it does stuff like that for you. That was what I used...

Otherwise, the usual way from the documentation.

$('#my-jplayer-id').on($.jPlayer.event.loadedmetadata, function(event) {
   console.log('Boom! The event goodies are: %o', event.jPlayer);
});
rliriano commented 10 years ago

Ive tried everything but I still cant get that file to play :(

happyworm commented 10 years ago

Maybe @rmhall knows the reason why.

If it is actually a file, then try playing it as an flv/fla format in jPlayer. As in , not through the RTMP server, but directly to the file.

rmhall commented 10 years ago

Hi - I tested the RTMP stream URL in question on Akamai with their tester here: http://support.akamai.com/flash/index.html?autostart=true&url=rtmp%3A//cp26115.edgefcs.net/ondemand/mpub/mps/catalog_95/000/000/044/asset_118/Beneath_Dead_Leaves.flv and it does stream fine. I'll take a look and see what might be the issue with jPlayer, I have a feeling its just the formatting of the RTMP url - will update this again when I have had a chance to confirm that.

rliriano commented 10 years ago

Awesome thanks @rmhall & @happyworm

rmhall commented 10 years ago

Ok so its not the formatting of the URL - there is metadata in the FLV, but the duration is coming back as 0, even though the metadata indicates it is 187.554 seconds in length. I'll have to dig a little deeper into this later after work - could be because of the differences in the metadata format for .flv's versus .mp3 and mp4, etc.

In the meantime, I would try replacing that file, and or re-encoding the meta-data in it. Also, unless you actually have video in the file, I'd suggest replacing this with an .mp3, or .mp4 audio only file.

happyworm commented 10 years ago

Thanks @rmhall

Have you had any success after re-encoding the files @rliriano ?

rliriano commented 10 years ago

@happyworm I need them to be .flv format, I have tried several tracks but with no luck

happyworm commented 10 years ago

Did we get any resolution to this?

The problem appeared to be related to the duration metadata, but we were not sure why the FLV duration was being read in as zero.

rliriano commented 10 years ago

Still no solution to this at all :/

rliriano commented 10 years ago

Hey did you guys even find anything on this? @happyworm @rmhall

spiralvisum commented 10 years ago

Hi.

I am using Nginx to rtmp stream .mp4 audio files. I would much rather use jplayer, but am having to use jwplayer because of an issue I can't quite figure out.

Here is what my URL looks like rtmp://IP:PORT/myapp/mp4:/content_id/001.mp4?pass=encryptedhash

I can get it to work in Akamai's tester, but jplayer doesn't seem to like it. I don't see where my server is receiving the request. Do you know of anything I could try or a place to look for errors or issues?

I posted to the Jplayer Google Group and Mark directed me here.