interfaced / zombiebox

JavaScript Smart TV development framework
https://zombiebox.tv
MIT License
106 stars 9 forks source link

HLS on Tizen #18

Open pedrosilvabos opened 2 years ago

pedrosilvabos commented 2 years ago

@l1bbcsg @reeFridge @nomean42 Hello, trying to play HLS on tyzen

video.prepare(url, {
    [PrepareOption.TYPE]: MediaType.HLS
});
video.once(video.EVENT_READY, () => video.play());

this will work in HTML and Webos but not on Tyzen.

Could you please send me a working hls on tyzen sample ? Thank you

criskurtin commented 2 years ago

I have this in my Player scene:

src/scenes/player.js

// ...

    play(url, options) {
        this._video.prepare(url, options);
    }

// ...

    _initVideo() {
        this._video = app.device.createStatefulVideo();

        // chrome "fix" - it won't autoplay anything anymore if it ain't muted...
            if (app.isDevicePc()) {
                    this._video.setMuted(true);
                }

        this._video.once(this._video.EVENT_READY, () => this._video.play());
                this._video.on(this._video.EVENT_ERROR, () => this._onError());
        }

// ...

and this in the main application.js: src/application.js

// ...

        /**
         * Plays the provided HLS m3u8 playlist
         */
    loadPlayerScene(streamUrl) {
        const player = this.getLayerManager().getLayer('player');

        return this.getSceneOpener().open(player, () => {
            player.play(streamUrl, {
                [PrepareOption.TYPE]: MediaType.HLS
            });
        });
    }

// ...

and it works perfectly fine. Using the latest official zombiebox and zombiebox-platform-tizen packages. I also had some issues initially but that turned out to be related to the SDK/emulator version. The latest version of TV emulator wouldn't load the application/stream correctly. Maybe it's the same issue as with LG webOS v5/v6 emulators which don't support HLS playback due to some limitations (even though the devices themselves play it normally). Check this response for more info...

All this is, of course, only helpful if you are trying to test it via emulatos. If it's about the real device, then it won't help much. The only thing that comes across my mind is if your device DUID is not linked to the distributor certificate or if you need to open Device Manager and right click the device > permit to install applications.

P.S. maybe this issue should be moved to zombiebox-platform-tizen issues