Skip to content

Implemented new setting to order source quality settings#306

Open
jakecausier wants to merge 4 commits intoOvenMediaLabs:masterfrom
jakecausier:feature/sortable-quality-levels
Open

Implemented new setting to order source quality settings#306
jakecausier wants to merge 4 commits intoOvenMediaLabs:masterfrom
jakecausier:feature/sortable-quality-levels

Conversation

@jakecausier
Copy link

I've implemented a new setting for the player to use called sourcesOrder, which can organise the quality levels provided by a source either by bitrate, video width, video height, or by custom ordering with the label provided by the encoder.

The value can be provided as a string, object, or array. Some examples below:

Order by labels:

let player = OvenPlayer.create("player", {
    sources : [
        {
            type : "webrtc",
            file :  "https://path.to/your_video",
            label : "WebRTC"
        },
    ],
    sourcesOrder : [
        'High',
        'Medium',
        'Low'
    ]
});

Order by Bitrate, ascending:

let player = OvenPlayer.create("player", {
    sources : [
        {
            type : "webrtc",
            file :  "https://path.to/your_video",
            label : "WebRTC"
        },
    ],
    sourcesOrder : 'bitrate'
});

Order by video width, descending:

let player = OvenPlayer.create("player", {
    sources : [
        {
            type : "webrtc",
            file :  "https://path.to/your_video",
            label : "WebRTC"
        },
    ],
    sourcesOrder : {
        orderBy: 'width',
        order: 'DESC'
    }
});

This fixes an issue submitted to the OvenMediaEngine repo:
OvenMediaLabs/OvenMediaEngine#863

Feel free to give suggestions or improvements as this is my first PR to the repo, I've done my best to keep it to the same style of code already written.

@SangwonOh SangwonOh self-requested a review June 12, 2023 05:05
@SangwonOh
Copy link
Member

@jakecausier Hi! I am very sorry for the late review. It's a very nice feature. But I reviewed it too late, so this commit is way behind master. If it's okay, please close this pull request and make your request again. If you have any other opinions, please leave a comment.

Thank you very much for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants