ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:24.77 GB of 70.42 GB (35.17%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ http/ root/ hls/ tests/ unit/ controller/ - drwxr-xr-x

Directory:
Viewing file:     timeline-controller.js (4.41 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import TimelineController from '../../../src/controller/timeline-controller';
import Hls from '../../../src/hls';

describe('TimelineController', function () {
  let timelineController;
  let hls;

  beforeEach(function () {
    hls = new Hls();
    hls.config.enableWebVTT = true;
    timelineController = new TimelineController(hls);
    timelineController.media = document.createElement('video');
  });

  it('should set default track to showing when displaySubtitles is true', function () {
    hls.subtitleTrackController = { subtitleDisplay: true };

    timelineController.onManifestLoaded({
      subtitles: [{ id: 0 }, { id: 1, default: true }]
    });

    expect(timelineController.textTracks[0].mode).to.equal('disabled');
    expect(timelineController.textTracks[1].mode).to.equal('showing');
  });

  it('should set default track to hidden when displaySubtitles is false', function () {
    hls.subtitleTrackController = { subtitleDisplay: false };

    timelineController.onManifestLoaded({
      subtitles: [{ id: 0 }, { id: 1, default: true }]
    });

    expect(timelineController.textTracks[0].mode).to.equal('disabled');
    expect(timelineController.textTracks[1].mode).to.equal('hidden');
  });

  describe('reuse text track', function () {
    it('should reuse text track when track order is same between manifests', function () {
      hls.subtitleTrackController = { subtitleDisplay: false };

      timelineController.onManifestLoaded({
        subtitles: [{ id: 0, name: 'en' }, { id: 1, name: 'ru' }]
      });

      // text tracks model contain only newly added manifest tracks, in same order as in manifest
      expect(timelineController.textTracks[0].label).to.equal('en');
      expect(timelineController.textTracks[1].label).to.equal('ru');
      expect(timelineController.textTracks.length).to.equal(2);
      // text tracks of the media contain the newly added text tracks
      expect(timelineController.media.textTracks[0].label).to.equal('en');
      expect(timelineController.media.textTracks[1].label).to.equal('ru');
      expect(timelineController.media.textTracks.length).to.equal(2);

      timelineController.onManifestLoaded({
        subtitles: [{ id: 0, name: 'en' }, { id: 1, name: 'ru' }]
      });

      // text tracks model contain only newly added manifest tracks, in same order
      expect(timelineController.textTracks[0].label).to.equal('en');
      expect(timelineController.textTracks[1].label).to.equal('ru');
      expect(timelineController.textTracks.length).to.equal(2);
      // text tracks of the media contain the previously added text tracks, in same order as the manifest order
      expect(timelineController.media.textTracks[0].label).to.equal('en');
      expect(timelineController.media.textTracks[1].label).to.equal('ru');
      expect(timelineController.media.textTracks.length).to.equal(2);
    });

    it('should reuse text track when track order is not same between manifests', function () {
      hls.subtitleTrackController = { subtitleDisplay: false };

      timelineController.onManifestLoaded({
        subtitles: [{ id: 0, name: 'en' }, { id: 1, name: 'ru' }]
      });

      // text tracks model contain only newly added manifest tracks, in same order as in manifest
      expect(timelineController.textTracks[0].label).to.equal('en');
      expect(timelineController.textTracks[1].label).to.equal('ru');
      expect(timelineController.textTracks.length).to.equal(2);
      // text tracks of the media contain the newly added text tracks
      expect(timelineController.media.textTracks[0].label).to.equal('en');
      expect(timelineController.media.textTracks[1].label).to.equal('ru');
      expect(timelineController.media.textTracks.length).to.equal(2);

      timelineController.onManifestLoaded({
        subtitles: [{ id: 0, name: 'ru' }, { id: 1, name: 'en' }]
      });

      // text tracks model contain only newly added manifest tracks, in same order
      expect(timelineController.textTracks[0].label).to.equal('ru');
      expect(timelineController.textTracks[1].label).to.equal('en');
      expect(timelineController.textTracks.length).to.equal(2);
      // text tracks of the media contain the previously added text tracks).to.equal(in opposite order to the manifest order
      expect(timelineController.media.textTracks[0].label).to.equal('en');
      expect(timelineController.media.textTracks[1].label).to.equal('ru');
      expect(timelineController.media.textTracks.length).to.equal(2);
    });
  });
});
Command:
Quick Commands:
Upload:
[Read-Only] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [Read-Only]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 0.3794 seconds