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

Possible to change label and/or watermark with load() #258

Open
sephentos opened this issue Jan 24, 2022 · 2 comments
Open

Possible to change label and/or watermark with load() #258

sephentos opened this issue Jan 24, 2022 · 2 comments
Labels
feature requests Suggest new features that you and others would find useful.

Comments

@sephentos
Copy link

sephentos commented Jan 24, 2022

I have multiple different mp4 files which I like to serve.

A JS event triggers the change with...

... (within a click event listener) ..
...
            player.stop();
            player.load([{
                waterMark: {
                    text: 'new watermark text',
                    image: "/assets/img/watermark.png",
                    y: "20px",
                    x: "20px",
                    width: "80px",
                    height: "15px",
                    position: "top-left",
                    opacity: 0.7
                },
                label: 'new label',
                type: 'mp4',
                file: <mp4 file>
            }]);
            player.play();
...

This currently "only" works for changing the media file, but the label and watermark text remains unchanged.
Is there a possibility to also change these values ​​with load()?

global OvenPlayer create:

let player = OvenPlayer.create('player', {
    autoStart: true,
    controls: true,
    image: "/assets/img/poster.jpg",
    waterMark: {
        text: 'first file to be shown when entering the site',
        image: "/assets/img/watermark.png",
        y: "20px",
        x: "20px",
        width: "80px",
        height: "15px",
        position: "top-left",
        opacity: 0.7
    },
    label: 'first file to be shown when entering the site',
    type: 'mp4',
    file: <first file to be shown when entering the site>
});
@SangwonOh
Copy link
Member

@sephentos Hi. As you said load() works for only the media file. We are now dealing with that by removing (remove()) the player and re-creating(OvenPlayer.create()) it. It would be nice if setImage() and setWatermark() APIs were added. However, the implementation is likely to take some time due to the low priority. Thanks!

@sephentos
Copy link
Author

@sephentos Hi. As you said load() works for only the media file. We are now dealing with that by removing (remove()) the player and re-creating(OvenPlayer.create()) it. It would be nice if setImage() and setWatermark() APIs were added. However, the implementation is likely to take some time due to the low priority. Thanks!

Thanks for the reply!

Alright, I understand.

Hope to see such an option in the future. It would be even nicer if the same parameters as with OvenPlayer.create() could be used in load() so that the player would automatically rebuild itself with the new parameters.

@SangwonOh SangwonOh added the feature requests Suggest new features that you and others would find useful. label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests Suggest new features that you and others would find useful.
Projects
None yet
Development

No branches or pull requests

2 participants