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..51f2b0fe77f5cefcea2204137d6e0fd24cb27c42 |
--- /dev/null |
+++ b/media/base/media_content_type.h |
@@ -0,0 +1,35 @@ |
+// 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 { |
mlamouri (slow - plz ping)
2016/08/18 14:33:15
I'm not a huge fan of the name but I don't really
|
+ // Type indicating that a player is primary content on the page. |
+ Content, |
+ // Type indicating that a player only plays a transient sound. |
+ Transient, |
+ // Type indicating that a player cannot be paused. MediaSession may duck the |
+ // player instead of pausing it. |
+ Unpausable, |
+ // Type indicating that a player cannot be controlled. MediaSession wil ignore |
+ // this player. |
+ Uncontrollable |
+}; |
+ |
+// Utility function for deciding whether a player is treated as Content type by |
mlamouri (slow - plz ping)
2016/08/18 14:33:15
nit: s/treated as Content type by/treated as Conte
|
+// its duration. |
+MEDIA_EXPORT MediaContentType |
+DurationToMediaContentType(base::TimeDelta duration); |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_BASE_MEDIA_CONTENT_TYPE_H_ |