clappr-level-selector-plugin icon indicating copy to clipboard operation
clappr-level-selector-plugin copied to clipboard

How to append source list dynamically?

Open mikeevstropov opened this issue 9 years ago • 14 comments

like this:

[
    { 'src' : 'http://example.com/playlist1-1/index.m3u8', 'label' : '720p' }
    { 'src' : 'http://example.com/playlist1-2/index.m3u8', 'label' : '1080p' }
]

If you have example please show it. Thank you!

mikeevstropov avatar Feb 21 '16 17:02 mikeevstropov

ref: https://github.com/clappr/clappr-level-selector-plugin/issues/23

me-vlad avatar Feb 21 '16 20:02 me-vlad

Now i'm using this way:

var player = new Clappr.Player({
    parentId    : '#player',
    autoplay    : false,
    sources     : [
        'http://example.com/source1/index.m3u8',
        'http://example.com/source2/index.m3u8',
        'http://example.com/source3/index.m3u8'
    ],
    plugins     : { 'core': [LevelSelector] },
    levelSelectorConfig: {
        labels: {
            3 : '1080p',
            2 : '720p',
            1 : '480p',
            0 : '360p'
        }
    },
});

But in bitrate list i see only first src.

mikeevstropov avatar Feb 21 '16 20:02 mikeevstropov

I have the same issue here, anyone ?

gabrielirdeb avatar Mar 03 '16 12:03 gabrielirdeb

@mikeevstropov and @gabrielirdeb I don't this is a "real" issue, at the best we can see this as a new feature. In theory your variant (master) playlist should be generated in your server, this would provide a smooth playback change.

Besides, this also raises a lot of questions about the expected behavior:

    sources     : [
        'http://example.com/source1/index.m3u8',
        'http://example.com/source2/index.m3u8',
        'http://example.com/source3/index.m3u8'
    ],

How should we handle this sources?

  • play one after the other (binge watch) ?
  • use it as fallback (a la html5 video) ?
  • use it to compose a playback with different bitrates ?

Maybe we could force a list of qualities (this might be very easy to do), what do you think @clappr/core ?

    levelSelectorConfig: {
        levels: {
            [label: '1080p', src: ''http://example.com/source1/index.m3u8''],
            [label: '1080p', src: ''http://example.com/source1/index.m3u8''],
            [label: '1080p', src: ''http://example.com/source1/index.m3u8''],
            [label: '1080p', src: ''http://example.com/source1/index.m3u8'']
        }
    },

leandromoreira avatar Mar 03 '16 14:03 leandromoreira

@leandromoreira , @clappr/core +1 for quality list option May be it helps to define avaliable levels for native HLS? https://github.com/clappr/clappr-level-selector-plugin/issues/23

me-vlad avatar Mar 03 '16 14:03 me-vlad

that's right @me-vlad what do you think @cowai ?

leandromoreira avatar Mar 03 '16 14:03 leandromoreira

I agree with @leandromoreira, this would fit better as a specific level selector option. Since the sources parameter is handled by a separate plugin, this would cause a number of weird conflicts that we could avoid by handling this separately.

Taking the suggested config, the plugin could switch sources using load() by itself, and providing an initial seek value, thus avoiding conflicts with other plugins.

towerz avatar Mar 03 '16 14:03 towerz

@leandromoreira This seems like a good solution. By defining it in the plugin we can write our own hls parsers to pass to the plugin. Nice and clean.

ariselseng avatar Mar 04 '16 11:03 ariselseng

I made a #30 for it after that we also need to provide the documentation, this also relies at clappr PR (which I'm doing now :P )

    levelSelectorConfig: {
        levels: [
            {id: 0, label: '1080p', src: "http://example.com/source1/index.m3u8"},
            {id: 1, label: '1080p', src: "http://example.com/source1/index.m3u8"},
            {id: 2, label: '1080p', src: "http://example.com/source1/index.m3u8"},
            {id: 3, label: '1080p', src: "http://example.com/source1/index.m3u8"}
        ]
    }

leandromoreira avatar Mar 15 '16 17:03 leandromoreira

It is not so simple as I thought

leandromoreira avatar Mar 16 '16 12:03 leandromoreira

@leandromoreira Any news on this?

ariselseng avatar Mar 30 '16 13:03 ariselseng

@cowai I tried once but then I saw it's not easy... ;/ I'll try that later, the problems rises while you trying to change container (and it gets worst on mobile)

leandromoreira avatar Mar 30 '16 13:03 leandromoreira

Any news on this?

gabrielirdeb avatar Apr 25 '16 12:04 gabrielirdeb

We didn't have time yet to see =/ I'm sorry

leandromoreira avatar Apr 25 '16 12:04 leandromoreira