| Index: media/base/media_util.cc
|
| diff --git a/media/base/media_util.cc b/media/base/media_util.cc
|
| index a6516cd23058a1795f144fa23b1e57c6cc5c270a..b1a8826028a8f9f80cffbf7708f7dd75bcdef141 100644
|
| --- a/media/base/media_util.cc
|
| +++ b/media/base/media_util.cc
|
| @@ -4,6 +4,9 @@
|
|
|
| #include "media/base/media_util.h"
|
|
|
| +#include "base/command_line.h"
|
| +#include "media/base/media_switches.h"
|
| +
|
| namespace media {
|
|
|
| std::vector<uint8_t> EmptyExtraData() {
|
| @@ -19,4 +22,20 @@ EncryptionScheme AesCtrEncryptionScheme() {
|
| EncryptionScheme::Pattern());
|
| }
|
|
|
| +std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) {
|
| + if (command_line.HasSwitch(switches::kIgnoreAutoplayRestrictionsForTests))
|
| + return switches::autoplay::kNoUserGestureRequiredPolicy;
|
| +
|
| + // Return the default policy if none is specified in the command line.
|
| + if (!command_line.HasSwitch(switches::kAutoplayPolicy)) {
|
| +#if defined(OS_ANDROID)
|
| + return switches::autoplay::kUserGestureRequiredPolicy;
|
| +#else
|
| + return switches::autoplay::kNoUserGestureRequiredPolicy;
|
| +#endif
|
| + }
|
| +
|
| + return command_line.GetSwitchValueASCII(switches::kAutoplayPolicy);
|
| +}
|
| +
|
| } // namespace media
|
|
|