Ramaraju.d
Ramaraju.d

Reputation: 1353

Sending an audio file path to email and there by playing the audio in jwplayer when clicked on link

One of my friend sent me an email. It contains a path to audio file. When i click on the link the audio starts playing (only if it is .mp3 format) in chrome.

This is not the case every time A user may send any kind of format Ex: aac,m4a etc.

So i would like to play the audio in a jwplayer

On clicking the url the audio must be able to play in the browser using jwplayer. The path to the audio file is bitle generated short url.

I downloaded jwplayer files and source code from http://www.longtailvideo.com/players/jw-flv-player/ and i set up my player accordingly to document. But still facing the problem

Kindly give suggestions.

Upvotes: 0

Views: 384

Answers (1)

pogeybait
pogeybait

Reputation: 3145

JWPlayer is nice but it lacks a good interface. I have been able to embed jwplayer into prettyphoto and that has solved a lot of issues for me.

There is an article that describes how to do this located at http://forums.no-margin-for-errors.com/discussion/5671/how-to-integrate-jwplayer-in-prettyphoto-with-flash-and-html5/p1

Once you get that working my suggestion would be for the url to contain GET vars that include the filename to be played. Use PHP to create an href that will trigger prettyphoto/jwplayer to open and play the file.

Also, the instructions on the link I gave you did not work for me. I had to modify them but here is the code that got it to work:

case 'jwplayer':
    pp_dimensions = _fitToViewport(movie_width,movie_height); // Fit item to viewport
    controlbar_height = 29; //Allow for JWplayer's bar
    pp_dimensions['height']+=controlbar_height;pp_dimensions['contentHeight']+=controlbar_height;pp_dimensions['containerHeight']+=controlbar_height;

    jwplayer_settings = {flashplayer: '/jwplayer/player.swf', controlbar: 'bottom', skin: '/jwplayer/jwplayer_skin.zip', autostart: true, id: 'jwplayer1'};
    jwplayer_settings.width = pp_dimensions['width'];
    jwplayer_settings.height= pp_dimensions['height'];
    jwplayer_settings.file = pp_images[set_position];
    skipInjection = true;
    /* include jwplayer JS embedder */
    $.getScript('/jwplayer/jwplayer.js', function() {
        jwplayer("pp_full_res").setup(jwplayer_settings);
        _showContent();
    });
break;

Upvotes: 1

Related Questions