Languages

Menu
Sites
Language
Unable to publish my app because censors can't see HLS.

Hi. I have an app with HLS and I can see the video here, on my TV. So it works! When I'm trying to publish this app, guys from TIZEN can't review it, because they can't see HLS. I gave them direct links so they can use any player they want to run the video and they CAN see the HLS now. 

What is the problem and how to solve it?

 

Here is the part of my code.

Btw, can someone edit this post and put all the code in here? I just can't paste it!

 

// create video object
    var avplayer = document.createElement('object');
        avplayer.setAttribute('id', 'plugin');
        avplayer.setAttribute('type', 'application/avplayer');
        avplayer.setAttribute('style', 'width:1920px;height:1080px;opacity:1!important;z-index:-1!important;');
    document.querySelector('body').appendChild(avplayer);

    var plugin = webapis.avplay,
        listener = {};

    var self = this;
    WebPlayerStrategy.call(this, { plugin: plugin });

    var paused = true,
        throwPlayingEvent = true;

    function init() {
        try {
            listener = {
                onbufferingstart: function () {
                    throwPlayingEvent = true;
                    self.event(self.TYPE.WAITING);
                },

                onbufferingprogress: function (percent) { },

                onbufferingcomplete: function () { },

                oncurrentplaytime: function (currentTime) {
                    paused = false;
                    self.event(self.TYPE.TIMEUPDATE);
                    if (throwPlayingEvent) {
                        throwPlayingEvent = false;
                        self.event(self.TYPE.PLAYING);
                    }
                },

                onevent: function (eventType, eventData) { },

                onerror: function (eventType) {
                    self.event(self.TYPE.ERROR, self.ERROR.UNDEFINED);
                },

                onsubtitlechange: function (duration, text, data3, data4) { },

                onstreamcompleted: function () {
                    self.event(self.TYPE.ENDED); // ended event
                }
            }
        } catch (e) {
            console.log(e);
        }
    }

    /*------------------*/
    /* Override methods */
    /*                  */

    self.deinit = function () {
        if (plugin) {
            self.stop();
            plugin.close();
        }
        plugin = null;
        $("#plugin").remove();
    };

    self.setUrlPlayer = function (url, startVideo) {
        plugin.open(url); // 1. Call webapis.avplay.open()
        self.setDisplayVideo(0, 0, 1920, 1080); // 4. Set media size by webapis.avplay.setDisplayRect()
        plugin.currentUrl = url;
        plugin.setListener(listener); // 2. Set listener event by webapis.avplay.setListener()
        plugin.prepare(); // 3. Call webapis.avplay.prepare()
        if (startVideo === false) {
            // do nothing...
        } else {
            self.event(self.TYPE.LOADEDMETADATA, { videoWidth: 1920, videoHeight: 1080 });
            self.play(); // 5. Call webapis.avplay.play()
        }
    };

    // выставить url и (не)начать проигрывать
    self.setUrl = function (url, startVideo) {
        url += '|COMPONENT=HLS';
        // webapis.avplay.setStreamingProperty("ADAPTIVE_INFO", "BITRATES=" + 50000 + '~' + $('#BITRATE_TO').val() + 'STARTBITRATE=' + $('#START_BITRATE').val() + 'SKIPBITRATE=' + $('#SKIP_BITRATE').val());
        try {
            //webapis.avplay.setStreamingProperty("WIDEVINE", drmParam);
            self.setUrlPlayer(url, startVideo);
        } catch (e) {
            console.log(e);
        }
    };

    // играть
    self.play = function (pos) {
        if (pos) {
            self.jumpTo(pos, true);
        } else {
            paused = false;
            plugin.play();
            self.event(self.TYPE.PLAY);
        }
    };

 

 

 

Edited by: polusov on 06 Oct, 2016

Responses

1 Replies
Yasin Ali

Hello,

You can try comparing your code with the example in this guide:

AVPlay Tutorial

Adaptive streaming (DASH/HLS/Smooth Streaming)

 

You may also post the issue in the samsungDForum

https://www.samsungdforum.com/SamsungDForum/ForumDashBoard/cd10341507013d28