app/Resources/static-src/app/js/activity/video/video-recorder.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

import 'store';

export default class VideoRecorder {
  constructor(container) {
    this.container = container;
    this.interval = $(this.container).data('watchTimeSec');
    this.playerCounter = 0;
    this.activityId = $(this.container).data('id');
  }

  addVideoPlayerCounter(emitter, player) {
    let playerCounter = store.get('activity_id_' + this.activityId + '_playing_counter');
    if (!playerCounter) {
      this.playerCounter = 0;
    }
    if (!(player && player.playing)) {
      return false;
    }
    if (playerCounter >= this.interval) {
      this.watching(emitter);
    } else if (player.playing) {
      this.playerCounter++;
    }
    store.set('activity_id_' + this.activityId + '_playing_counter', this.playerCounter);
  }

  watching(emitter) {
    let watchTime = store.get('activity_id_' + this.activityId + '_playing_counter');
    console.log(watchTime);
    emitter.emit('watching', {watchTime: watchTime}).then(() => {
      let url = $('#video-content').data('watchUrl');
      $.post(url, function (response) {
        if (response && response.status == 'error') {
          window.location.reload();
        }
      });
    }).catch((error) => {
      console.error(error);
    });
    this.playerCounter = 0;
  }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。