Run exoplayer from command line

This is currently tested with exoplayer version 2.5.4.
am output:

 specifications include these flags and arguments:
    [-a ] [-d ] [-t ]
    [-c  [-c ] ...]
    [-e|--es   ...]
    [--esn  ...]
    [--ez   ...]
    [--ei   ...]
    [--el   ...]
    [--ef   ...]
    [--eu   ...]
    [--ecn  ]
    [--eia  [, [,)
    [--ela  [, [,)
    [--efa  [, [,)
    [--esa  [, [,; to embed a comma into a string,
         escape it using "\,")
    [-f ]
    [--grant-read-uri-permission] [--grant-write-uri-permission]
    [--grant-persistable-uri-permission] [--grant-prefix-uri-permission]
    [--debug-log-resolution] [--exclude-stopped-packages]
    [--include-stopped-packages]
    [--activity-brought-to-front] [--activity-clear-top]
    [--activity-clear-when-task-reset] [--activity-exclude-from-recents]
    [--activity-launched-from-history] [--activity-multiple-task]
    [--activity-no-animation] [--activity-no-history]
    [--activity-no-user-action] [--activity-previous-is-top]
    [--activity-reorder-to-front] [--activity-reset-task-if-needed]
    [--activity-single-top] [--activity-clear-task]
    [--activity-task-on-home]
    [--receiver-registered-only] [--receiver-replace-pending]
    [--receiver-foreground] [--receiver-no-abort]
    [--receiver-include-background]
    [--selector]
    [ |  | ]

So we can pass in URI.
BUT we can pass one and only one URI, this is the limitation.
Haven't found the solution yet.
Basic on this log(custom log):

PlayerActivityTAG: C.WIDEVINE_UUID.toString() = edef8ba9-79d6-4ace-a3c8-27dcd51d21ed
PlayerActivityTAG: C.PLAYREADY_UUID.toString() = 9a04f079-9840-4286-ab92-e65be0885f95
PlayerActivityTAG: C.PLAYREADY_UUID.toString() = 9a04f079-9840-4286-ab92-e65be0885f95

We can run exoplayer with command:

am start -W -a com.google.android.exoplayer.demo.action.VIEW -c android.intent.category.DEFAULT \
-d "https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd" \
-e drm_scheme_uuid "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" \
-e drm_license_url "https://proxy.uat.widevine.com/proxy?provider=widevine_test" \
-e extension "mpd" \
"com.google.android.exoplayer2.demo/com.google.android.exoplayer2.demo.PlayerActivity"

Or run mixed stream:

public static final String URI_LIST_EXTRA = "uri_list";
...
if (ACTION_VIEW.equals(action)) {
      uris = new Uri[]{intent.getData()};
      extensions = new String[]{intent.getStringExtra(EXTENSION_EXTRA)};
    } else if (ACTION_VIEW_LIST.equals(action)) {
      String[] uriStrings = intent.getStringArrayExtra(URI_LIST_EXTRA);
      uris = new Uri[uriStrings.length];
      for (int i = 0; i < uriStrings.length; i++) {
        uris[i] = Uri.parse(uriStrings[i]);
      }
      extensions = intent.getStringArrayExtra(EXTENSION_LIST_EXTRA);
      if (extensions == null) {
        extensions = new String[uriStrings.length];
}
am start -W -a com.google.android.exoplayer.demo.action.VIEW_LIST -c android.intent.category.DEFAULT \
--esa uri_list "https://html5demos.com/assets/dizzy.mp4"\,\
"https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_sd.mpd"\,\
"https://html5demos.com/assets/dizzy.mp4"\,\
"https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_sd.mpd"\,\
"https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_sd.mpd" \
-e drm_scheme_uuid "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" \
-e drm_license_url "https://proxy.uat.widevine.com/proxy?provider=widevine_test" \
"com.google.android.exoplayer2.demo/com.google.android.exoplayer2.demo.PlayerActivity"

你可能感兴趣的:(Run exoplayer from command line)