naiveproxy/services/media_session/public/mojom/audio_focus.mojom
2018-12-09 21:59:24 -05:00

29 lines
1020 B
Plaintext

// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module media_session.mojom;
import "services/media_session/public/mojom/media_session.mojom";
// These are the different types of audio focus that can be requested.
enum AudioFocusType {
// Request permanent audio focus when you plan to play audio for the
// foreseeable future (for example, when playing music) and you expect
// the previous holder of audio focus to stop playing.
kGain,
// Request transient focus when you expect to play audio for only a
// short time and you expect the previous holder to pause playing.
kGainTransientMayDuck,
};
// The observer for audio focus events.
interface AudioFocusObserver {
// The given |session| gained audio focus with the specified |type|.
OnFocusGained(MediaSession session, AudioFocusType type);
// The given |session| lost audio focus.
OnFocusLost(MediaSession session);
};