Brought up to date with the private repository (feea4c7)

This commit is contained in:
S committed 2026-10-14 20:57:33 +03:00
1 parent 1aa738d692
commit 1b1df1ae48
7925 files changed
+2617237 -20

No files matched your search

@@ -0,0 +1,45 @@
package org.osmf.elements.audioClasses
{
import flash.events.Event;
import org.osmf.traits.TimeTrait;
public class AudioTimeTrait extends TimeTrait
{
private var soundAdapter:SoundAdapter;
public function AudioTimeTrait(param1:SoundAdapter)
{
super();
this.soundAdapter = param1;
param1.addEventListener("progress",onDownloadProgress,false,0,true);
param1.addEventListener("downloadComplete",onDownloadComplete,false,0,true);
param1.addEventListener("complete",onPlaybackComplete,false,0,true);
}
override public function get currentTime() : Number
{
return soundAdapter.currentTime;
}
private function onDownloadProgress(param1:Event) : void
{
if(!isNaN(soundAdapter.estimatedDuration) && soundAdapter.estimatedDuration > 0)
{
soundAdapter.removeEventListener("progress",onDownloadProgress);
setDuration(soundAdapter.estimatedDuration);
}
}
private function onDownloadComplete(param1:Event) : void
{
setDuration(soundAdapter.estimatedDuration);
}
private function onPlaybackComplete(param1:Event) : void
{
signalComplete();
}
}
}