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

When playing Tizen mpd video, the video may be played in an infinite loop. #4640

Open
jgt1027 opened this issue Dec 6, 2024 · 2 comments
Open
Labels

Comments

@jgt1027
Copy link

jgt1027 commented Dec 6, 2024

Environment
  • Link to playable MPD file:
  • Dash.js version:
  • Browser name/version:
  • OS name/version:

"dashjs": "4.7.0",
its a tizen application
Tizen/WebOS

Steps to reproduce
  1. Please provide clear steps to reproduce your problem
    Sometimes I get reports from customers that live TV channels have infinite loops only in Samsung. But the problem is that I use other platforms like Tizen, the only one that does loops, Exoplayer on Android from LG (WebOS), AV Player on iOS, and all of these platforms survive very well.

Both web players and LG endure gaps, don't cause loops, and share everything with the same codebase and player version, so it has to do with how Samsung plays content in some way.
I can share the URL for the actual MPD, but the problem is only a few times a week, so it's very difficult to debug on the actual channel.

Content loops on Tizen, but not on Web/LG. Please let me know what I can test to make playback more robust on Tizen and make it work the same as on LG/Web.

It has been confirmed that other players also had the problem and it has been resolved. Can dashjs also solve the problem?

Attached is the url of the problematic part of the player.
'shaka-project/shaka-player#7124'

Observed behavior

Describe what the player is doing that is unexpected or undesired behaviour.

Console output
Paste the contents of the browser console here.
You may need to enable debug logging in dash.js by calling player.updateSettings({ 'debug': { 'logLevel': dashjs.Debug.LOG_LEVEL_DEBUG }}) if you are using your own page.
Expected behavior

Describe what the player is expected to do

@jgt1027 jgt1027 added the Bug label Dec 6, 2024
@dsilhavy
Copy link
Collaborator

dsilhavy commented Dec 6, 2024

It looks like Shaka implements an additional configurable offset when performing gap jumps.

Gap jumping in dash.js is handled in the GapController. We can add a new setting settings.streaming.gaps.offset or similar that users can change depending on the target platform. @jgt1027 Are you able to look into this and provide a pull request

@jgt1027
Copy link
Author

jgt1027 commented Dec 9, 2024

Hello, I think it will be difficult to give you a pull-quest due to internal security.
We will give you some excerpts of the sauce of the part we are using and the contents below.

                fullVideoPlayer.initialize(play, this.url, true, this.runningTime);
                fullVideoPlayer.on(dashjs.MediaPlayer.events['ERROR'], function (e) {
                    console.log('error : ', e);
                })
                fullVideoPlayer.on(dashjs.MediaPlayer.events['MANIFEST_LOADING_STARTED'], function (e) {
                    let dom = document.querySelector('.video-js .vjs-loading-spinner')
                    if (dom) {
                        dom.innerHTML ='영상을 불러오는중입니다.'
                    }
                })
                fullVideoPlayer.on(dashjs.MediaPlayer.events['MANIFEST_LOADED'], function (e) {
                    if(loadUrl != e.data.originalUrl) {
                        loadUrl = e.data.originalUrl;
                        videoSetTimeout = setTimeout(() => {
                            if ($this.runningTime > 0) {
                                fullVideoPlayer.seek($this.runningTime);
                            } else {
                                fullVideoPlayer.seek(0);
                            }
                        }, 100)
                    }
                })
                fullVideoPlayer.on(dashjs.MediaPlayer.events['PLAYBACK_ENDED'], function (e) {
                    console.log('video End');
                    $this.clearVideoPlayTimeSetTimeout();
                })

                fullVideoPlayer.on(dashjs.MediaPlayer.events['PLAYBACK_TIME_UPDATED'], function (e) {
                    if ($this.startShowAd) {
                        if ($this.play) {
                            $this.switchPlay(false)
                        } else {
                            fullVideoPlayer.pause();
                        }
                    }
                    $this.currentVideoTime = isNaN(e.time.toFixed(0)) ? 0 : Number(e.time.toFixed(0));
                    $this.endVideoTime = Math.ceil(e.timeToEnd + e.time);
                    if (!$this.startShowAd && $this.endVideoTime != null && $this.endVideoTime > 0 && $this.adCount * $this.adCycle <= $this.adPlayTime) {
                        $this.openAdVideo();
                    }
                    function checkPopup(startShowAd, endVideoTime, adPopupCount, adPopupCycle, adPlayTime) {
                        if(startShowAd || $this.endVideoTime == null) return false;
                        if( endVideoTime <= 0) return false;
                        if( adPopupCount == 0 && adPlayTime === 60) return true;
                        if( adPopupCount != 0 && adPopupCount * adPopupCycle <= adPlayTime) return true;
                        return false;
                    }
                    //if (!$this.startShowAd && $this.endVideoTime != null && $this.endVideoTime > 0 && ($this.adPopupCount + 1) * $this.adPopupCycle <= $this.adPlayTime) {
                    if(checkPopup($this.startShowAd, $this.endVideoTime, $this.adPopupCount, $this.adPopupCycle, $this.adPlayTime)) {
                        $this.openPopupAdVideo();
                    }
                    if ((Number($this.endVideoTime) - Number($this.currentVideoTime)) <= 1) {
                        if (Number($this.currentVideoTime) !== 0 && Number($this.endVideoTime) !== 0) {
                            $this.nextTimerCount = 10;
                            $this.clearNextVideoCount();
                            $this.setNextVideoCount();
                        }
                    }
                    $this.setVideoPlayTimeSetTimeout();
                })

                fullVideoPlayer.on(dashjs.MediaPlayer.events['PLAYBACK_PAUSED'], function (e) {
                    console.log("PLAYBACK_PAUSED");
                    $this.clearTimerAddedVideoPlayTime();
                    $this.clearHitCount();
                    $this.play = false;
                    $this.statisticsContent('stop');
                    $this.clearVideoPlayTimeSetTimeout();
                })

                fullVideoPlayer.on(dashjs.MediaPlayer.events['PLAYBACK_PLAYING'], function (e) {
                    console.log("PLAYBACK_PLAYING");
                        $this.runTimerAddedVideoPlayTime();
                        $this.runTimerAddHit();
                        $this.statisticsContent('play');
                        $this.play = true;
                        $this.setVideoPlayTimeSetTimeout();
                })

                fullVideoPlayer.on(dashjs.MediaPlayer.events['BUFFER_EMPTY'], function (e) {
                    console.log("BUFFERING_STARTED");
                    $this.clearTimerAddedVideoPlayTime();  // 타이머 일시 정지
                });

                fullVideoPlayer.on(dashjs.MediaPlayer.events['BUFFER_LOADED'], function (e) {
                    console.log("BUFFERING_ENDED");
                    $this.runTimerAddedVideoPlayTime();  // 타이머 재개
                });


                fullVideoPlayer.updateSettings({
                    'debug': {
                        'logLevel': dashjs.Debug.LOG_LEVEL_NONE
                    },
                    streaming: {
                        'abr': {
                            'initialBitrate': {
                                'video': 4194304 * 10
                            },
                            'limitBitrateByPortal': false, 
                        },
                        cacheInitSegments: true
                    },
                });
                fullVideoPlayer.preload();
               

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants