Embed an AAC or MP3 audio player (UI)

Learn how to get the JWP player to embed and instantiate in audio mode


JWP players can be embedded to playback audio files. The following sections explain JWP audio file player embedding best practices. For additional information on JWP's audio playback capabilities see Supported video and audio formats reference.

The below example uses an audio file with a maximum height setting of 40 pixels. With this setting, the player enters audio mode and hides the video display and other non-essential control bar items, such as fullscreen.


πŸ“˜

  • Although the above example uses an AAC audio file in an MP4 container, MP3 audio is also supported across virtually all desktop browsers and mobile devices.
  • Less common audio file formats (like Ogg Vorbis or Shoutcast) should be avoided because they are not supported ubiquitously.
  • MP3 streaming via HLS manifest (m3u8) is not supported.


Embed an audio player

Follow the steps below to embed an audio player on a web page:

  1. Add a cloud-hosted or self-hosted player to the page.

  2. Add the audio player. Be sure to define the audio file (file).

    <div id="myElement">Loading the player...</div>
    
    <script type="text/javascript">
        jwplayer("myElement").setup({
            "file": "//example.com/uploads/myVideo.m4a",
            "width": 640,
            "height": 40
        });  
    </script>
    
  3. (Optional) Adjust the configuration options for the player.



© 2007-2024 Longtail Ad Solutions, Inc.