[go: nahoru, domu]

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

Hope multipart of flvjs can be supported. #59

Closed
vcheckzen opened this issue Mar 19, 2020 · 1 comment
Closed

Hope multipart of flvjs can be supported. #59

vcheckzen opened this issue Mar 19, 2020 · 1 comment

Comments

@vcheckzen
Copy link
vcheckzen commented Mar 19, 2020

Here is the multipart doc of flvjs. DPlayer can work with the code below, but ArtPlayer doesn't do.

DPlayer

new DPlayer({
    autoplay: true,
    container: document.querySelector('.player'),
    video: {
        type: 'customFlv',
        customType: {
            customFlv: function (video, player) {
                const flvPlayer = flvjs.createPlayer({
                    "type": "flv",
                    "duration": 1373161,
                    "segments": [
                        {
                            "duration": 333438,
                            "filesize": 60369190,
                            "url": "http://127.0.0.1/flv/7182741-1.flv"
                        }, {
                            "duration": 390828,
                            "filesize": 75726439,
                            "url": "http://127.0.0.1/flv/7182741-2.flv"
                        }, {
                            "duration": 434453,
                            "filesize": 103453988,
                            "url": "http://127.0.0.1/flv/7182741-3.flv"
                        }, {
                            "duration": 214442,
                            "filesize": 44189200,
                            "url": "http://127.0.0.1/flv/7182741-4.flv"
                        }
                    ]
                });
                flvPlayer.attachMediaElement(video);
                flvPlayer.load();
                player.on('destroy', function () {
                    flvPlayer.destroy()
                });
            },
        },
    },
})

Artplayer

new Artplayer({
    autoplay: true,
    container: '.player',
    customType: {
        flv: function (video) {
            const flvPlayer = flvjs.createPlayer({
                "type": "flv",
                "duration": 1373161,
                "segments": [
                    {
                        "duration": 333438,
                        "filesize": 60369190,
                        "url": "http://127.0.0.1/flv/7182741-1.flv"
                    }, {
                        "duration": 390828,
                        "filesize": 75726439,
                        "url": "http://127.0.0.1/flv/7182741-2.flv"
                    }, {
                        "duration": 434453,
                        "filesize": 103453988,
                        "url": "http://127.0.0.1/flv/7182741-3.flv"
                    }, {
                        "duration": 214442,
                        "filesize": 44189200,
                        "url": "http://127.0.0.1/flv/7182741-4.flv"
                    }
                ]
            });
            flvPlayer.attachMediaElement(video);
            flvPlayer.load();
        }
    }
})
@vcheckzen
Copy link
Author

Sorry, I forget to add property of type: 'flv'.

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

No branches or pull requests

1 participant