media_content_type.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_BASE_MEDIA_CONTENT_TYPE_H_
  5. #define MEDIA_BASE_MEDIA_CONTENT_TYPE_H_
  6. #include "base/time/time.h"
  7. #include "media/base/media_export.h"
  8. namespace media {
  9. // The content type of a media player, which will be used by MediaSession to
  10. // control its players.
  11. enum class MediaContentType {
  12. // Type indicating that a player is persistent, which needs to take audio
  13. // focus to play.
  14. Persistent,
  15. // Type indicating that a player only plays a transient sound.
  16. Transient,
  17. // Type indicating that a player is a Pepper instance. MediaSession may duck
  18. // the player instead of pausing it.
  19. Pepper,
  20. // Type indicating that a player cannot be controlled. MediaSession will take
  21. // audio focus when the player joins but will not let it respond to audio
  22. // focus changes.
  23. OneShot,
  24. // The maximum number of media content types.
  25. Max = OneShot,
  26. };
  27. // Utility function for deciding the MediaContentType of a player based on its
  28. // duration.
  29. MEDIA_EXPORT MediaContentType
  30. DurationToMediaContentType(base::TimeDelta duration);
  31. } // namespace media
  32. #endif // MEDIA_BASE_MEDIA_CONTENT_TYPE_H_