Ah-ha. After testing id3 tags with 3 different mp3 files that all
should have had id3 tags, and trying everything, I tried one more mp3 file: bingo. Added MediaPlayer.getMetadata() and a METADATA event. Contents of metadata vary by media being played and are open for interpretation by users of the player. FLV video returns their metadata object. MP3 audio returns id3 tags. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@708 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -117,6 +117,12 @@ public class Mp3AudioPlayer extends EventDispatcher
|
||||
return _volume;
|
||||
}
|
||||
|
||||
// from AudioPlayer
|
||||
public function getMetadata () :Object
|
||||
{
|
||||
return (_sound == null) ? null : _sound.id3;
|
||||
}
|
||||
|
||||
// from AudioPlayer
|
||||
public function unload () :void
|
||||
{
|
||||
@@ -132,6 +138,9 @@ public class Mp3AudioPlayer extends EventDispatcher
|
||||
_lastPosition = NaN;
|
||||
}
|
||||
|
||||
/**
|
||||
* Play without updating the current state.
|
||||
*/
|
||||
protected function play0 () :void
|
||||
{
|
||||
pause0();
|
||||
@@ -143,6 +152,9 @@ public class Mp3AudioPlayer extends EventDispatcher
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause without saving the position or updating the state.
|
||||
*/
|
||||
protected function pause0 () :void
|
||||
{
|
||||
if (_chan != null) {
|
||||
@@ -177,7 +189,7 @@ public class Mp3AudioPlayer extends EventDispatcher
|
||||
|
||||
protected function handleId3 (event :Event) :void
|
||||
{
|
||||
trace("Got ID3");
|
||||
dispatchEvent(new ValueEvent(MediaPlayerCodes.METADATA, _sound.id3));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user