まあ、私は音楽の素晴らしいプレイリストを作成しようとしているだけで、PHPファイルを使用しています。今1つのPHPファイルと複数のメディアファイルでプレイリストを作成するには?
、このコードで、私は、単一のメディアファイルソースから曲をストリーミングすることができます。
<?php
// Try and open the remote stream
if (!$stream = fopen('http://example.com/audio.mp3', 'r')) {
// If opening failed, inform the client we have no content
header('HTTP/1.1 500 Internal Server Error');
exit('Unable to open remote stream');
}
// It's probably an idea to remove the execution time limit - on Windows hosts
// this could result in the audio stream cutting off mid-flow
set_time_limit(0);
// Inform the client we will be sending it some MPEG audio
header('Content-Type: audio/mpeg');
// Send the data
fpassthru($stream);
// Thanks DaveRandom
?>
ので、アイデアはほとんど単純です:一つのPHPファイルと、プレイリストを作成します。 phpファイルは最初の曲をストリーミングしてから、前に設定した別の曲を再生し、phpファイルのすべてのソースを繰り返し再生します。
ありがとうございました。
一度に1つのmp3を処理するための単一のPHPファイルを用意し、クライアント側のスクリプティングを使用して非同期的に呼び出すことをお勧めします(つまり、jQueryの$ .get())。 – wyqydsyq