Captioning\Format\JsonCue::setStartOfParagraph PHP Method

setStartOfParagraph() public method

public setStartOfParagraph ( $startOfParagraph )
$startOfParagraph
    public function setStartOfParagraph($startOfParagraph)
    {
        $this->startOfParagraph = $startOfParagraph;
        return $this;
    }

Usage Example

Beispiel #1
0
 public function parse()
 {
     $decodedContent = json_decode($this->fileContent, true);
     if (!isset($decodedContent['captions'])) {
         throw new \InvalidArgumentException('Invalid JSON subtitle');
     }
     if (count($decodedContent['captions']) > 0) {
         foreach ($decodedContent['captions'] as $c) {
             $cue = new JsonCue($c['startTime'], $c['startTime'] + $c['duration'], $c['content']);
             $cue->setDuration($c['duration']);
             $cue->setStartOfParagraph($c['startOfParagraph']);
             $this->addCue($cue);
         }
     }
     return $this;
 }