Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I add a playlist to audio? #181

Open
my-instantcms opened this issue Aug 11, 2020 · 1 comment
Open

How do I add a playlist to audio? #181

my-instantcms opened this issue Aug 11, 2020 · 1 comment

Comments

@my-instantcms
Copy link

Hello.
Who has an example of audio code with a playlist, please show me

@etomProductions
Copy link

etomProductions commented Aug 26, 2020

Did you checked the demo?!!!

`	<div class="media-wrapper">
        <audio id="player2" preload="none" controls width="750"
               data-cast-title="Jazz Example"
               data-cast-description="This is a description for audio only"
               data-cast-poster="http://mediaelementjs.com/images/big_buck_bunny.jpg">
            <source src="http://www.largesound.com/ashborytour/sound/AshboryBYU.mp3" type="audio/mp3" title="Jazz Example" data-playlist-thumbnail="http://mediaelementjs.com/images/big_buck_bunny.jpg" data-playlist-description="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vestibulum justo arcu. Vestibulum commodo lacus bibendum sollicitudin commodo.">
            <source src="https://api.soundcloud.com/tracks/323195515/stream?client_id=95f22ed54a5c297b1c41f72d713623ef" type="audio/mp3" title="Soundcloud rocks!" data-playlist-description="Curabitur et malesuada arcu. Praesent hendrerit, quam vel pellentesque aliquam, metus felis mattis velit, quis varius metus diam vitae diam. Integer ante massa, tempor in accumsan eu, sodales in lectus.">
            <source src="rtmp://s3b78u0kbtx79q.cloudfront.net/cfx/st/mp3:fake_empire-cbr" type="rtmp/video" title="Playing RTMP audio...">
        </audio>
    </div>
<script>
	var mediaElements = document.querySelectorAll('audio');

	for (var i = 0, total = mediaElements.length; i < total; i++) {
		new MediaElementPlayer(mediaElements[i], {
			features: ['prevtrack', 'playpause', 'nexttrack', 'current', 'progress', 'duration', 'volume', 'playlist', 'shuffle', 'loop', 'fullscreen', 'showPlaylist'],
		});
	}
</script>

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants