SoundManager2 onid3 () does not work

I am creating a simple Javascript jukebox using the latest SoundManager2 to play sound, with the source files being MP3s. I have downloaded file upload and file sorting, and at the moment I'm trying to access the ID3 data of these MP3 files, but the onid3 () callback does not work. I use Flash and verified that ID3 information is present in the files. Below is my implementation of onid3 ():

function playNextSongInQueue()
{
    // Get the first element of the songQueue array
    var nextSongInQueue = songQueue.shift();

    // Start playback from the queue
    var jukeboxTune = soundManager.createSound({
        id: 'currentTune',
        url: 'audio/' + nextSongInQueue.name,
        onload: function() {
            this.play();
        },
        onid3: function() {
            alert('ID3 present!');
        },
        onfinish: function() {
            this.destruct();    // Destroy this sound on finish
            songFinish();       // Run the songFinish() function, so decide what to do next
        }
    });

    jukeboxTune.load();
    //jukeboxTune.play();           // The jukebox running!

    songPlaying = true;             // Set songPlaying flag
    updateSongQueueDisplay();       // Refresh the song queue display (for debug)

    return nextSongInQueue.name;
}

, onid3() . , , . SoundManager , onid3() , usePolicyFile true - , MP3 , , XML .

, ? , Google , , . , Javascript, SoundManager, , PHP-.

,

+3
2

, , , Javascript SM2.

Nihilogic ID3v1 ( http://blog.nihilogic.dk/2008/08/reading-id3-tags-with-javascript.html), antimatter15 js-id3v2 (https://github.com/antimatter15/js-id3v2), ID3v2. , MP3 <input>.

+1

( ), id3v2.js

ID3, SM2 mp3-, . , Soundcloud, MP3 Amazon S3... PHP script URL- , SM2 crossdomain.xml(Check https://getsatisfaction.com/schillmania/topics/displaying_waveformdata_of_soundcloud_hosted_track_prompts_securityerror_error_2122)

, S3 (blob) .

!

0

Source: https://habr.com/ru/post/1785744/


All Articles