Jumbotron::setVideoBackground

@param string        $src
@param string|null   $poster

@return static
329702
public function setVideoBackground($src, $poster = null)
    {
        $this->attributes->addAttributeClass('jumbotron-video');

        $video = new Element('video', 'jumbotron-video');

        if (isset($poster)) {
            $video->attributes->addAttribute('poster', $poster);
        }

        $video->attributes->addAttribute('width', '100%');
        $video->attributes->addAttribute('preload', 'auto');
        $video->attributes->addAttribute('loop', null);
        $video->attributes->addAttribute('autoplay', null);
        $video->attributes->addAttribute('muted', null);

        $source = new Element('source', 'jumbotron-video-source');

        if (is_file($src)) {
            $src = path_to_url($src);
        }

        $source->attributes->addAttribute('src', $src);
        $source->attributes->addAttribute('type', 'video/webm');

        $video->textContent->push($source->render());

        $this->childNodes->prepend($video);

        return $this;
    }
774945
public function getFeaturedVideo(ConnectionInterface $con = null)
    {
        if ($this->aFeaturedVideo === null && ($this->video_id !== null)) {
            $this->aFeaturedVideo = ChildVideoQuery::create()->findPk($this->video_id, $con);
            /* The following can be used additionally to
                guarantee the related object contains a reference
                to this object.  This level of coupling may, however, be
                undesirable since it could result in an only partially populated collection
                in the referenced object.
                $this->aFeaturedVideo->addFeaturedSkills($this);
             */
        }

        return $this->aFeaturedVideo;
    }
606627
public static function videoHtml($poster, $sources, $width = 0, $height = 0)
    {
        $code = self::element('video', [
            'poster' => ($poster ?: null),
            'width' => ($width ?: null),
            'height' => ($height ?: null),
            'controls' => true,
        ]);

        foreach ((array) $sources as $source) {
            $code .= self::element('source', ['src' => $source]);
        }

        return $code.'</video>';
    }
336101
@Override
	public final void startCapture() throws V4L4JException {
		state.start();

		// make sure we have a push source
		if(pushSource == null) {
			state.rollback();
			throw new V4L4JException("setCaptureCallback() must be called with a valid "
					+ "callback object before startCapture()"); 
		}

		// start the push source and wait until it's blocked on getVideoFrame()
		pushSource.startCapture();
		state.waitForAtLeastOneUser();

		try {
			// start video capture and enqueue all buffers
			start(object);
		} catch (V4L4JException e) {
			// Error starting the capture...

			// stop the push source thread
			pushSource.stopCapture();

			// return to previous state
			state.rollback();

			// propagate exception
			throw e;
		}

		// change state to STARTED
		state.commit();

		// put all frames into the available queue and wake up push source thread
		synchronized(availableVideoFrames){
			availableVideoFrames.addAll(videoFrames);
			availableVideoFrames.notifyAll();
		}
	}
481736
public DrawerProfile setBackground(Context context, Bitmap background) {
        mBackground = new BitmapDrawable(context.getResources(), background);
        notifyDataChanged();
        return this;
    }
431572
public function newImage($width, $height, $background = null)
    {
        // create empty resource
        $core = imagecreatetruecolor($width, $height);
        $image = new \Intervention\Image\Image(new static, $core);

        // set background color
        $background = new Color($background);
        imagefill($image->getCore(), 0, 0, $background->getInt());

        return $image;
    }
856255
public static function frameImageOne($field, $title, $src, $value = '')
    {
        return self::frame($field, $title, $src, (string)$value, Frame::TYPE_IMAGE);
    }
1151897
public function downloadRemoteSource($src)
    {
        if (!$this->isRemoteSourceOnWhitelist($src)) {
            throw new Exception("Hostname is not on whitelist for remote sources.");
        }

        $remote = new CRemoteImage();

        if (!is_writable($this->remoteCache)) {
            $this->log("The remote cache is not writable.");
        }

        $remote->setCache($this->remoteCache);
        $remote->useCache($this->useCache);
        $src = $remote->download($src);

        $this->log("Remote HTTP status: " . $remote->getStatus());
        $this->log("Remote item is in local cache: $src");
        $this->log("Remote details on cache:" . print_r($remote->getDetails(), true));

        return $src;
    }
1078092
public function set_source(string $src){
    $this->source = is_file($src) ? file_get_contents($src) : $src;
    $this->parsed = [];
    return $this;
  }
904984
public function setPosterUrl($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->poster_url !== $v) {
            $this->poster_url = $v;
            $this->modifiedColumns[VideoTableMap::COL_POSTER_URL] = true;
        }

        return $this;
    }
896428
public static void setBackground(View v, @DrawableRes int drawableRes) {
        ViewCompat.setBackground(v, ContextCompat.getDrawable(v.getContext(), drawableRes));
    }
763463
protected function background($color = null)
    {
        if (!is_null($color)) {
            $this->resource->setImageBackgroundColor(sprintf('#%s', $color));
        }
        return $this;
    }
366797
public void setShowProgressBackground(boolean show) {
        Drawable drawable = getCurrentDrawable();
        if (drawable instanceof ShowBackgroundDrawable) {
            ((ShowBackgroundDrawable) drawable).setShowBackground(show);
        }
        Drawable indeterminateDrawable = getIndeterminateDrawable();
        if (indeterminateDrawable instanceof ShowBackgroundDrawable) {
            ((ShowBackgroundDrawable) indeterminateDrawable).setShowBackground(show);
        }
    }
1071915
static public function image($src, $settings=null)
    {
        $isBase64 = $src && strpos($src, 'data:image') !== false;
        if (!empty($src)) {
            if (!$isBase64 && strpos($src, ',') !== false) {
                $srcs = StringHelper::toArray($src, ',');
                $src = empty($srcs[0]) ? $srcs[1] : $srcs[0];
            }
        }
        if (!$src) {
            $src = Config::getRootUrl(). '/images/nopic.gif';
        } else {
            if (strpos($src, 'http:') === false && !$isBase64 ) {
                if (strpos($src, '/images') === 0) {
                    $src = Config::getRootUrl() . $src;
                } elseif (strpos($src, ':') === false) {
                    $src = Config::getUploadFileUrl($src);
                }
            }
        }
        
        $ext = pathinfo($src, PATHINFO_EXTENSION);
        if (!$isBase64 && !in_array($ext, ['gif', 'jpe', 'jpeg', 'jpg', 'png'])) {
            return '<a href="' . $src . '" target="_blank">查看</a>';
        }
        
        $settings = static::formatSettings($settings);
        $class = isset($settings['class']) ? $settings['class'] : ''; // img-responsive
        $class && $class = ' class="' . $class . '"';
        $style = isset($settings['style']) && $settings['style'] ? $settings['style'] : ($class ? '' : 'max-width:100%;max-height:100%');
        $style && $style = ' style="' . $style . '"';
        
        $idstr = isset($settings['id']) && $settings['id'] ? ' id="' . $settings['id'] . '"' : '';
        
        $str = '<img src="' . $src . '"' . $idstr . $class . $style . '>';
        if (isset($settings['url'])) {
            $str = '<a href="' . $settings['url'] . '">' . $str . '</a>';
        }
        
        return $str;
    }
64483
public static function frameInputs($field, $title, $src, array $value = [])
    {
        return self::frame($field, $title, $src, $value);
    }
1155768
public function setBackgroundColor(\Jdenticon\Color $color)
    {
        parent::setBackgroundColor($color);
        $this->canvas->backColor = $this->backgroundColor->toRgba();
    }
1095511
public static function canvas($width, $height, $background = null)
    {
        return self::getManager()->canvas($width, $height, $background);
    }