How to use the @cycjimmy/awesome-js-funcs/judgeBasic/isString function in @cycjimmy/awesome-js-funcs

To help you get started, we’ve selected a few @cycjimmy/awesome-js-funcs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cycjimmy / jsmpeg-player / src / lib / video-element.js View on Github external
pause: () => {
        },
        stop: () => {
        },
        load: () => {
        },
      }, hooks),
    }, overlayOptions);

    this.options.needPlayButton = this.options.control && !this.options.picMode;

    this.player = null;

    // Setup canvas and play button
    this.els = {
      wrapper: isString(wrapper)
        ? document.querySelector(wrapper)
        : wrapper,
      canvas: null,
      playButton: document.createElement('div'),
      unmuteButton: null,
      poster: null,
    };

    if (window.getComputedStyle(this.els.wrapper).getPropertyValue('position') === 'static') {
      this.els.wrapper.style.position = 'relative';
    }

    this.els.wrapper.clientRect = this.els.wrapper.getBoundingClientRect();

    this.initCanvas();
    this.initPlayButton();
github cycjimmy / jsmpeg-player / src / lib / video-element.js View on Github external
initCanvas() {
    if (this.options.canvas) {
      this.els.canvas = isString(this.options.canvas)
        ? document.querySelector(this.options.canvas)
        : this.options.canvas;
    } else {
      this.els.canvas = document.createElement('canvas');
      this.els.canvas.classList.add(_style.canvas);
      this.els.wrapper.appendChild(this.els.canvas);
    }
  };
github cycjimmy / h5-webpack-starter / app / share / QueryAll.js View on Github external
constructor(selectorOrEls, context = document) {
    let elements = null;

    if (isString(selectorOrEls)) {
      elements = context.querySelectorAll(selectorOrEls);
    } else {
      elements = selectorOrEls;
    }

    this.nodeList = nodeListToArray(elements);
  };
github cycjimmy / h5-video-player / src / index.js View on Github external
constructor(source, {
    context = 'body',
    control = false,
    autoPlay = false,
    autoClose = true,
    preload = true,
    orientation = 'portrait',
    aspectRatio = 0,
    disableRotation = false,
    picMode = false,
    fixAndroidWechatContinue = false,
    hooks = {},
  }) {

    this.context = isString(context)
      ? document.querySelector(context)
      : context;
    this.options = {
      source,
      control,
      autoPlay,
      autoClose,
      preload,
      orientation,
      aspectRatio: aspectRatio || (() => orientation === 'landscape'
        ? 16 / 9
        : 9 / 16)(),
      disableRotation,
      picMode,
      fixAndroidWechatContinue,
    };
github cycjimmy / h5-webpack-starter / app / share / Templates.js View on Github external
constructor(template, selectorOrEl, data) {
    if (isString(selectorOrEl)) {
      this.element = document.querySelector(selectorOrEl);
    } else {
      this.element = selectorOrEl;
    }

    this.template = template;
    this.jsonData = data;
  }