Demo entry 6229963

vk audio ads?

   

Submitted by tratata on Oct 13, 2016 at 10:28
Language: JavaScript. Code size: 3.9 kB.

if (!this._trackSlider) {
        var A = s.isAdPlaying() ? s.adsGetCurrentProgress() : s.getCurrentProgress()
          , P = s.isAdPlaying() ? 0 : s.getCurrentBuffered();
        this._trackSlider = new Slider(geByClass1("audio_page_player_track_slider", d),{
            value: A,
            backValue: P,
            size: 1,
            hintClass: "audio_player_hint",
            withBackLine: !0,
            formatHint: function(e) {
                var i = s.getCurrentAudio() || o._readyAudio;
                return i = AudioUtils.asObject(i),
                formatTime(Math.round(e * i.duration))
            },
            onEndDragging: function(e) {
                s.seek(e)
            }
        }),
        s.isAdPlaying() && this._trackSlider.toggleAdState(!0),
        this._volumeSlider = new Slider(geByClass1("audio_page_player_volume_slider", d),{
            value: s.getVolume(),
            size: 1,
            hintClass: "audio_player_hint",
            log: !0,
            formatHint: function(e) {
                return Math.round(100 * e) + "%"
            },
            onChange: function(e) {
                s.setVolume(e)
            }
        }),
        this.ap.on(this, AudioPlayer.EVENT_AD_DEINITED, function() {
            this._trackSlider.toggleAdMarker(!1)
        }
        .bind(this)),
        this.ap.on(this, AudioPlayer.EVENT_AD_READY, function() {
            this._trackSlider.toggleAdMarker(!0)
        }
        .bind(this)),
        this.ap.on(this, AudioPlayer.EVENT_AD_STARTED, function() {
            this._trackSlider.toggleAdMarker(!1),
            this._trackSlider.toggleAdState(!0),
            this._trackSlider.setBackValue(0)
        }
        .bind(this)),
        this.ap.on(this, AudioPlayer.EVENT_AD_COMPLETED, function() {
            this._trackSlider.toggleAdState(!1)
        }
        .bind(this)),
        this.ap.on(this, AudioPlayer.EVENT_START_LOADING, function() {
            o._trackSlider.toggleLoading(!0)
        }),
        this.ap.on(this, AudioPlayer.EVENT_CAN_PLAY, function() {
            o._trackSlider.toggleLoading(!1)
        }),
        this.ap.on(this, AudioPlayer.EVENT_ADDED, function(e, i) {
            e = AudioUtils.asObject(e),
            e && e.fullId == i && addClass(p, "audio_player_btn_added")
        }),
        this.ap.on(this, AudioPlayer.EVENT_REMOVED, function(e, i) {
            e = AudioUtils.asObject(e),
            e && e.fullId == i && removeClass(p, "audio_player_btn_added")
        }),
        this.ap.on(this, AudioPlayer.EVENT_PLAY, function(e, s, r) {
            delete o._readyAudio,
            data(d, "audio", e),
            a(),
            i(e),
            addClass(h, "audio_playing"),
            s && !cur.audioStartReadyAudio && (o._trackSlider.setBackValue(0),
            _.innerHTML = t(0, AudioUtils.asObject(e).duration),
            l.setAttribute("title", ""),
            l.titleSet = !1),
            c.innerHTML = getLang("global_audio_pause")
        }),
        this.ap.on(this, AudioPlayer.EVENT_PAUSE, function(e) {
            removeClass(h, "audio_playing"),
            c.innerHTML = getLang("global_audio_play")
        }),
        this.ap.on(this, AudioPlayer.EVENT_BUFFERED, function(e, i) {
            o._trackSlider.setBackValue(i)
        }),
        this.ap.on(this, AudioPlayer.EVENT_VOLUME, function(e, i) {
            o._volumeSlider.setValue(i)
        }),
        this.ap.on(this, AudioPlayer.EVENT_UPDATE, function(e, a) {
            e && i(e),
            this.ap.isAdPlaying() || e && a && (_.innerHTML = t(a, AudioUtils.asObject(e).duration))
        }
        .bind(this)),
        this.ap.on(this, AudioPlayer.EVENT_PROGRESS, function(e, i, a) {
            o._trackSlider.setValue(i),
            void 0 !== a && (_.innerHTML = t(i, a))
        })
    }

This snippet took 0.02 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).