Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented new setting to order source quality settings #306

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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:
AirenSoft/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.

None yet

2 participants