Web music player php

Содержание
  1. Saved searches
  2. Use saved searches to filter your results more quickly
  3. License
  4. akienz99/php-musicplayer
  5. Name already in use
  6. Sign In Required
  7. Launching GitHub Desktop
  8. Launching GitHub Desktop
  9. Launching Xcode
  10. Launching Visual Studio Code
  11. Latest commit
  12. Git stats
  13. Files
  14. README.md
  15. About
  16. Saved searches
  17. Use saved searches to filter your results more quickly
  18. music-player
  19. Here are 48 public repositories matching this topic.
  20. kalcaddle / kodbox
  21. fatg3erman / RompR
  22. thealoneprogrammer / Musical-World
  23. bigfa / nm
  24. nioc / web-music-player
  25. FarzadForuozanfar / Web-Music
  26. Greco395 / php-Music-Player
  27. Andrew-McGee / foam
  28. lifankohome / music-spider
  29. jhockofalltrades / Koffee-A-Web-based-Personal-Music-Player
  30. arghac14 / MusicPlayer-app
  31. Tonmoy-saha18 / Musicity-Beta
  32. hmerritt / groovebox-player
  33. panghaibin / online-music-player
  34. kenvilar / miozika
  35. tackyunicorn / streamp3
  36. UtopiaXC / My-Music-Player
  37. Daizygod / sukify
  38. kamshory / MusicPlayer
  39. xeurun / musicpoll
  40. Improve this page
  41. Add this topic to your repo
  42. Very Simple PHP Audio Player (With Playlist)
  43. TABLE OF CONTENTS
  44. PHP AUDIO PLAYER
  45. STEP 1) THE PHP & HTML
  46. STEP 2) JAVASCRIPT PLAYLIST INIT
  47. STEP 3) PLAY SONG
  48. DOWNLOAD & NOTES
  49. SUPPORT
  50. EXAMPLE CODE DOWNLOAD
  51. EXTRA BITS & LINKS
  52. CUSTOMIZING THE AUDIO PLAYER?
  53. COMPATIBILITY CHECKS
  54. LINKS & REFERENCES
  55. THE END
  56. Saved searches
  57. Use saved searches to filter your results more quickly
  58. License
  59. jasongi/PHP-MusicPlayer
  60. Name already in use
  61. Sign In Required
  62. Launching GitHub Desktop
  63. Launching GitHub Desktop
  64. Launching Xcode
  65. Launching Visual Studio Code
  66. Latest commit
  67. Git stats
  68. Files
  69. readme.md
  70. About

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

A simple PHP-Musicplayer with playlist and random modes

Читайте также:  Python const in class

License

akienz99/php-musicplayer

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This is a simple script which can

  • Build a Media library
  • Play random files from it
  • Play a playlist with ID’s from the Library

My idea is to make another script for this which allows you to have a LA(M)P-Server running which manages music requests. These could be added to a playlist.txt file on the server which gets downloaded by this client for a sort-of muiscbox for use i.e at bars.

  • PHP (>= 5.3.0) with PHP-Cli installed
  • Linux system (Windows and maybe MacOS X coming)
  • Installation of VLC Media Player

Put your audio-files inside the media folder

Firstly you have to update your library, therefor simply execute

Note: If the file lib.php does not exist, it will be generated automatically.

Starting the player in automatic mode

Now, to start the player in auto mode simply execute

Note: If you don’t include anything it will always launch auto mode.

To play a specific file simply start

where you replaye 123 with the ID of the desired song.

To play one random song type

php player.php play random

To play multiple random song enter

In the file player.php is a array called $config. There you cann change specific file paths, for example when your playlist is on a webserver.

If you find any bugs, please write an issue report. Thanks!

About

A simple PHP-Musicplayer with playlist and random modes

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

music-player

Here are 48 public repositories matching this topic.

kalcaddle / kodbox

kodbox is a file manager for web. It is a newly designed product based on kodexplorer. It is also a web code editor, which allows you to develop websites directly within the web browser.You can run kodbox either online or locally,on Linux, Windows or Mac based platforms

fatg3erman / RompR

Web client for Mopidy and MPD

thealoneprogrammer / Musical-World

DBMS Mini Project that basically designed for online music player

bigfa / nm

nioc / web-music-player

Web Music Player is a simple way to play your own music on any device connected to the web (pc, smartphone, tablet, . ). It can work as a standalone application or in your smartphone browser.

FarzadForuozanfar / Web-Music

Greco395 / php-Music-Player

GR3Music Player is a simple HTML5/PHP AudioPlayer for your music.

Andrew-McGee / foam

A Fomantic UI styled web music player frontend for Ampache. Designed to be minimal, tidy and usable.

lifankohome / music-spider

jhockofalltrades / Koffee-A-Web-based-Personal-Music-Player

arghac14 / MusicPlayer-app

Music Player web application using PHP, MySQL, where you can create and customize your playlist.

Tonmoy-saha18 / Musicity-Beta

It is an online-based music platform, where user can upload their own music and earn money from that music. If a song is not premium then the user can be able to listen to that music for free. If not then the user needs to buy that music, otherwise, the user can be able to listen to a little portion of that music.

hmerritt / groovebox-player

A self-hosted web-based music player — just drag, drop and listen 🎵

panghaibin / online-music-player

基于 MKOnlineMusicPlayer 魔改 新增支持歌词翻译合并,LRC 格式歌词生成下载,PDF 格式歌词下载,歌词区域全屏,墨水屏设备适配

kenvilar / miozika

🎵 🎶 🎧 A Music Streaming Service Web Application https://miozika.herokuapp.com/

tackyunicorn / streamp3

🎧 an SQL+HTML/PHP/CSS based mp3 player

UtopiaXC / My-Music-Player

这是一个本地化部署的基于Laravel的调用网易云API的网页音乐播放器。This is a localized deployment of Laravel-based web music player calling NetEase Cloud Music API.

Daizygod / sukify

kamshory / MusicPlayer

Music player using HTML5 Canvas and Audio

xeurun / musicpoll

MusicPoll — is a service for listen music with fun

Improve this page

Add a description, image, and links to the music-player topic page so that developers can more easily learn about it.

Add this topic to your repo

To associate your repository with the music-player topic, visit your repo’s landing page and select «manage topics.»

Источник

Very Simple PHP Audio Player (With Playlist)

Welcome to a tutorial on how to create a simple PHP audio player. Want to create your own podcast or playlist? Once upon a time, we have to fight with digital dragons and use all sorts of plugins to do that. But today, it is nearly as simple as using an tag. Read on for the example!

TABLE OF CONTENTS

PHP AUDIO PLAYER

All right, let us now get into how to create a PHP audio player with a playlist.

STEP 1) THE PHP & HTML

 
", GLOB_BRACE); // (B2) OUTPUT SONGS IN if (is_array($songs)) < foreach ($songs as $k=>$s) < $name = basename($s); printf("
> else < echo "No songs found!"; >?>

Yep, there are only 2 components for this simple example.

  1. The audio player, good old tag.
  2. The playlist.
    • We will use $songs = glob(«audio/*.», GLOB_BRACE) to get the list of songs from the audio folder. Take note, glob will not recursively read into sub-folders.
    • Then, loop through $songs and generate the playlist. Take note of the custom data-src here.

STEP 2) JAVASCRIPT PLAYLIST INIT

var aud = < // (A) INITIALIZE PLAYER player : null, // html element playlist : null, // html playlist now : 0, // current song init : () => < // (A1) GET HTML ELEMENTS aud.player = document.getElementById("demoAudio"); aud.playlist = document.querySelectorAll("#demoList .song"); // (A2) LOOP THROUGH ALL THE SONGS, CLICK TO PLAY for (let i=0; iaud.play(i); > // (A3) AUTO PLAY WHEN SUFFICIENTLY LOADED aud.player.oncanplay = aud.player.play; // (A4) AUTOPLAY NEXT SONG IN PLAYLIST WHEN CURRENT SONG ENDS aud.player.onended = () => < aud.now++; if (aud.now>=aud.playlist.length) < aud.now = 0; >aud.play(aud.now); >; > >; window.addEventListener("DOMContentLoaded", aud.init);

Unfortunately, does not support playlists at the time of writing. So we will need to build our own, var aud contains the mechanics of our custom playlist player.

  • (A1) Get the HTML elements.
    • aud.player refers to .
    • aud.playlist is an HTMLCollection of songs contained in .
    • The idea is to use aud.now to track the current song playing in aud.playlist . For example, aud.now = 0 will indicate the first song, aud.now = 1 indicates the second, and so on.

    STEP 3) PLAY SONG

    // (B) START PLAYING aud.play : < // (B1) UPDATE CURRENT & PLAY aud.now = id; aud.player.src = "audio/" + aud.playlist[id].dataset.src; // (B2) A LITTLE BIT OF COSMETIC for (let i=0; ielse < aud.playlist[i].classList.remove("now"); >> >;

    Lastly, we have a function that plays the song itself. Very simply, we set aud.play.src to the selected data-src . The end. aud.player.oncanplay will automatically start playing once sufficiently buffered.

    DOWNLOAD & NOTES

    Here is the download link to the example code, so you don’t have to copy-paste everything.

    SUPPORT

    600+ free tutorials & projects on Code Boxx and still growing. I insist on not turning Code Boxx into a «paid scripts and courses» business, so every little bit of support helps.

    EXAMPLE CODE DOWNLOAD

    Click here for the source code on GitHub gist, just click on “download zip” or do a git clone. I have released it under the MIT license, so feel free to build on top of it or use it in your own project.

    That’s all for the tutorial, and here is a small section on some extras and links that may be useful to you.

    CUSTOMIZING THE AUDIO PLAYER?

    Take extra note that cannot be styled or customized (at the time of writing). But we can build one ourselves, check out the custom audio player link below.

    COMPATIBILITY CHECKS

    Works on all modern “Grade A” browsers.

    THE END

    Thank you for reading, and we have come to the end. I hope that it has helped you to better understand, and if you want to share anything with this guide, please feel free to comment below. Good luck and happy coding!

    Источник

    Saved searches

    Use saved searches to filter your results more quickly

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

    A simple low-fi PHP script for creating a webpage that plays music.

    License

    jasongi/PHP-MusicPlayer

    This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

    Name already in use

    A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

    Sign In Required

    Please sign in to use Codespaces.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching GitHub Desktop

    If nothing happens, download GitHub Desktop and try again.

    Launching Xcode

    If nothing happens, download Xcode and try again.

    Launching Visual Studio Code

    Your codespace will open once ready.

    There was a problem preparing your codespace, please try again.

    Latest commit

    Git stats

    Files

    Failed to load latest commit information.

    readme.md

    PHP MusicPlayer — By Jason Giancono

    PHP MusicPlayer is exactly what it sounds like. A music player — written in PHP! See it in action here. (note: I got really old public domain music for the demo which doesn’t have any artist data, hence why it doesn’t show!)

    You need to have a web server with PHP installed. On the client side, you need a web broswer that is HTML5 compatible so it can read the tags.

    Let’s say you’re in a band and your album is about to drop — but you have no way to stream your music. PHP MusicPlayer can be set up in seconds! Seriously though, I made this as an easy way to share tracks with people without having to use soundcloud or dropbox etc.

    Seriously though — the use-cases for this are fairly limited, and I haven’t exactly put too much effort into the look/interface of the script. I know styling is supposed to be done in the CSS file, etc etc, but the point of this project was to make something as simple as possible, and having multiple files makes setting it up more complicated.

    To install, simply copy the index.php into a directory on your web server that has music files in it (mp3, wav or ogg). Drop in your album art with the filename album.png to have it come up. It is that simple — no customisation or config file fiddling needed.

    PHP MusicPlayer is extremely simple and low-fi. It scans the directory for files, and then sees if those files have any ID3 tags. If they do it shows the general ID3 information (track, title, artist and album), if they don’t it will just show the filename. It sorts by filename — which means the songs should be in album order for most namings as usually the track number is the first thing in the title — obviously not all music is like this, if you want it to be in album order then name your files that way. For each track, it provides a next and back button. Track names are passed via a GET parameter meaning you can link to any track. The music itself is played via HTML5 tags, super simple!

    About

    A simple low-fi PHP script for creating a webpage that plays music.

    Источник

Оцените статью