Skip to content

Commit

Permalink
Add ModDB and IndieDB video support (opengaming#849)
Browse files Browse the repository at this point in the history
* Add ModDB and IndieDB video support

* Add ModDB and IndieDB videos to Readme

* Minor fix
  • Loading branch information
pehsa authored and cxong committed Aug 10, 2019
1 parent 6c09ec2 commit 937b4dd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ images: array # Link(s) to screenshot(s)
video:
youtube: string # YouTube video ID
vimeo: number # Vimeo video ID
moddb: number # ModDB video ID
indiedb: number # IndieDB video ID

# * free means no cost, open means liberally licensed
```
Expand Down
4 changes: 4 additions & 0 deletions schema/games.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ schema;game:
max: 11
vimeo:
type: int
moddb:
type: int
indiedb:
type: int


# Based on SPDX license codes
Expand Down
2 changes: 2 additions & 0 deletions templates/games.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
{% if 'video' in game %}
{% if 'youtube' in game['video'] %}{{ video.render_youtube(game['video']['youtube']) }}{% endif %}
{% if 'vimeo' in game['video'] %}{{ video.render_vimeo(game['video']['vimeo']) }}{% endif %}
{% if 'moddb' in game['video'] %}{{ video.render_moddb(game['video']['moddb']) }}{% endif %}
{% if 'indiedb' in game['video'] %}{{ video.render_indiedb(game['video']['indiedb']) }}{% endif %}
{%- endif %}
</script>
</dd>
Expand Down
9 changes: 9 additions & 0 deletions templates/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@
<iframe src="https://player.vimeo.com/video/{{ vimeo_id }}?title=0&amp;byline=0&amp;portrait=0"
width="560" height="315" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
{%- endmacro %}

{%- macro render_moddb(moddb_id) -%}
<iframe width="560" height="315" src="https://www.moddb.com/media/iframe/{{ moddb_id }}" frameborder="0" allowfullscreen></iframe>
{%- endmacro %}

{%- macro render_indiedb(indiedb_id) -%}
<iframe width="560" height="315" src="https://www.indiedb.com/media/iframe/{{ indiedb_id }}" frameborder="0" allowfullscreen></iframe>
{%- endmacro %}

0 comments on commit 937b4dd

Please sign in to comment.