Skip to content

Commit

Permalink
Merge pull request #56 from GoogleWebComponents/no-default-video-id
Browse files Browse the repository at this point in the history
Removes the default video id. Only loads iframe API when it's set.
  • Loading branch information
ebidel committed Feb 11, 2016
2 parents 0949010 + 5a25ee5 commit 7e59a39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "YouTube video playback web component.",
"homepage": "https://googlewebcomponents.github.io/google-youtube",
"main": "google-youtube.html",
"version": "1.1.2",
"version": "1.2.0",
"authors": [
"Jeff Posnick <[email protected]>"
],
Expand Down
17 changes: 11 additions & 6 deletions google-youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@
<div id="container" style$="{{_computeContainerStyle(width, height)}}">
<template is="dom-if" if="{{thumbnail}}">
<img id="thumbnail"
src$="{{thumbnail}}"
title="YouTube video thumbnail."
alt="YouTube video thumbnail."
on-tap="_handleThumbnailTap">
src$="{{thumbnail}}"
title="YouTube video thumbnail."
alt="YouTube video thumbnail."
on-tap="_handleThumbnailTap">
</template>

<template is="dom-if" if="{{!thumbnail}}">
<google-youtube-api on-api-load="_apiLoad"></google-youtube-api>
<template is="dom-if" if="{{videoId}}">
<google-youtube-api on-api-load="_apiLoad"></google-youtube-api>
</template>
</template>

<!-- Use this._playsupportedLocalStorage as the value, since this.playsupported is set to
Expand Down Expand Up @@ -123,12 +125,15 @@
* to load a new video into the player (if `this.autoplay` is set to `1` and `playsupported` is true)
* or cue a new video otherwise.
*
* The underlying YouTube embed will not be added to the page unless this
* value is set.
*
* You can [search for videos programmatically](https://developers.google.com/youtube/v3/docs/search/list)
* using the YouTube Data API, or just hardcode known video ids to display on your page.
*/
videoId: {
type: String,
value: 'mN7IAaRdi_k',
value: '',
observer: '_videoIdChanged'
},

Expand Down

0 comments on commit 7e59a39

Please sign in to comment.