Skip to content

Commit

Permalink
Added thumbail support
Browse files Browse the repository at this point in the history
Added methods to Video class
  • Loading branch information
riccardo993 committed Jan 19, 2018
1 parent 5f6a62c commit 21978d3
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip

# Logs and databases #
######################
*.log
*.sql
*.sqlite

# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# SublimeText Configuration #
#############################
*.sublime-project
*.sublime-workspace
14 changes: 14 additions & 0 deletions src/Vod/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Video{
protected $title;
protected $uploadDate;
protected $visualizations;
protected $thumbnail;

const STATUS_MAP = [
0 => 'queued',
Expand All @@ -35,6 +36,8 @@ class Video{
24 => 'error'
];

const THUMBNAIL_URI = 'https://video.mainstreaming.tv/image/{{contentId}}/poster';

public function __construct(array $video) {
$this->contentId = $video['contentId'];
$this->customAttribute1 = $video['customAttribute1'];
Expand All @@ -61,6 +64,7 @@ public function __construct(array $video) {
$this->title = $video['title'];
$this->uploadDate = $video['uploadDate'];
$this->visualizations = $video['visualizations'];
$this->thumbnail = str_replace("{{contentId}}", $this->contentId, self::THUMBNAIL_URI);
}

public function getContentId()
Expand All @@ -75,6 +79,16 @@ public function getStatus()

return 'error';
}

public function getThumbnail()
{
return $this->thumbnail;
}

public function getVisualizations()
{
return $this->visualizations;
}
}

?>

0 comments on commit 21978d3

Please sign in to comment.