mpd:
- manifest_edit.plugins.mpd.manifest_order:
    # The manifest_order plugin will rearrange periods, adaptation sets or
    # representations order in mpd manifests.
    #
    # Tracks in mpd manifests are specified as list of Representations
    # inside a given Adaptation Set, inside a given Period. The general
    # scheme can roughly be illustrated as
    #
    # Manifest:
    #  |- Period id:
    #     id = "id"
    #     |- AdaptationSet :
    #        contentType = "audio"
    #        |- Representation
    #        |-   ...
    #        |- Representation
    #     |- AdaptationSet :
    #        contentType = "video"
    #        |- Representation
    #        |-   ...
    #        |- Representation
    #
    # In an mpd there could be multiple periods, each with multiple
    # adaptation sets, each with multiple representations, to form an
    # arbitrarily nested structure.
    #
    # This plugin can reorder any of this element (periods, adaptationSets
    # and representations) based on any of their properties.
    #
    # The plugin can apply reordering to the entire manifest or it can be
    # configured to process only certain periods or certain adaptation sets.
    #
    # Some examples:
    #
    # - reorder periods by decreasing order of id:
    #
    #    periods:
    #      plugin_config:
    #        orderBy :      "id"
    #        orderCriteria: "desc"
    #
    # - reorder adaptation sets by contentType, decreasing
    #    order, only for those adaptation sets in period with id = "1"
    #
    #    periods:
    #      - id : "1"
    #        adaptationSets:
    #          plugin_config:
    #            orderBy :      "contentType"
    #            orderCriteria: "desc"
    #
    # - reorder adaptation sets in any period that has an "id" property,
    #    by contentType, decreasing order
    #
    #    periods:
    #      - id : '.*'
    #        adaptationSets:
    #          plugin_config:
    #            orderBy :      "contentType"
    #            orderCriteria: "desc"
    #
    # - reorder adaptation sets in any period that does not have an "id"
    #    property, by contentType, decreasing order
    #
    #    periods:
    #      - id : ''
    #        adaptationSets:
    #          plugin_config:
    #            orderBy :      "contentType"
    #            orderCriteria: "desc"
    #
    # - reorder the representations lists present in any period, in
    #    adaptation sets with contentType="video", based on bandwidth,
    #    ascending order:
    #
    #    periods:
    #      - '*' : '.*'
    #        adaptationSets:
    #          - contentType :  "video"
    #            representations:
    #              plugin_config:
    #                orderBy :      "bandwidth"
    #                orderCriteria: "asc"
    #
    # - reorder the representations lists present in any period, in
    #    adaptation sets with contentType="video", based on bandwidth,
    #    ascending order AND, in adaptation sets with contentType="audio",
    #    based on bandwidth in descending order:
    #
    #    periods:
    #      - '*' : '.*'
    #        adaptationSets:
    #          - contentType :  "video"
    #            representations:
    #              plugin_config:
    #                orderBy :      "bandwidth"
    #                orderCriteria: "asc"
    #          - contentType :  "audio"
    #            representations:
    #              plugin_config:
    #                orderBy :      "bandwidth"
    #                orderCriteria: "desc""
    #
    #  You can refer to Manifest Edit user manual for more advanced
    #   configuration examples.
    periods:
      - '*' : '.*'
        adaptationSets:
          - contentType :  "video"
            representations:
              plugin_config:
                orderBy :      "bandwidth"
                orderCriteria: "desc"
          - contentType :  "audio"
            representations:
              plugin_config:
                orderBy :      "bandwidth"
                orderCriteria: "desc"

