Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: media/base/media_content_type.h

Issue 1996043002: Split MediaContentType and AudioFocusType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/media_content_type.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_content_type.h
diff --git a/media/base/media_content_type.h b/media/base/media_content_type.h
new file mode 100644
index 0000000000000000000000000000000000000000..e1b3943ba3d08d4ddd4c7c1cbadde8727bdbd42c
--- /dev/null
+++ b/media/base/media_content_type.h
@@ -0,0 +1,36 @@
+// Copyright 2016 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.
+
+#ifndef MEDIA_BASE_MEDIA_CONTENT_TYPE_H_
+#define MEDIA_BASE_MEDIA_CONTENT_TYPE_H_
+
+#include "base/time/time.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+// The content type of a media player, which will be used by MediaSession to
+// control its players.
+enum class MediaContentType {
+ // Type indicating that a player is persistent, which needs to take audio
+ // focus to play.
+ Persistent,
+ // Type indicating that a player only plays a transient sound.
+ Transient,
+ // Type indicating that a player is a Pepper instance. MediaSession may duck
+ // the player instead of pausing it.
+ Pepper,
+ // Type indicating that a player cannot be controlled. MediaSession wil ignore
+ // this player.
+ Uncontrollable
+};
+
+// Utility function for deciding the MediaContentType of a player based on its
+// duration.
+MEDIA_EXPORT MediaContentType
+DurationToMediaContentType(base::TimeDelta duration);
+
+} // namespace media
+
+#endif // MEDIA_BASE_MEDIA_CONTENT_TYPE_H_
« no previous file with comments | « media/base/BUILD.gn ('k') | media/base/media_content_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698