GoogleWebComponents / google-youtube

YouTube video playback web component
https://elements.polymer-project.org/elements/google-youtube
Other
131 stars 58 forks source link

Changing the video shows the thumbnail and the video embed #46

Open ronnyroeller opened 9 years ago

ronnyroeller commented 9 years ago

I added to the (stripped down) demo a button which allows changing the video:

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../google-youtube.html">

<dom-module id="demo-element">
  <template id="page-template">
    <google-youtube id="custom"
                    video-id="yRbOSdAe_JU"
                    thumbnail="//www.polymer-project.org/images/logos/p-logo.svg">
    </google-youtube>

    <button on-tap='changeVideo'>Change video</button>
  </template>
</dom-module>
<script>
  Polymer({
    is: 'demo-element',
    changeVideo: function(ev) {
        this.$.custom.videoId = '0GxteaIaj2Q';
        this.$.custom.thumbnail = 'http://i.ytimg.com/vi/0GxteaIaj2Q/hqdefault.jpg';
    }
  });
</script>

Initially, the user sees the first thumbnail: youtube-bug-1

Clicking on the thumbnail starts the correct video: youtube-bug-2

After clicking the button to change the video, the new thumbnail is shown but the video embed is still visible: youtube-bug-3

I would expect to see only the new thumbnail. I would expect that the video embed is no longer in the DOM.

jeffposnick commented 9 years ago

There's a bug in the demo, with videoid being used incorrectly when videoId should be used: https://github.com/GoogleWebComponents/google-youtube/pull/47

I see that you recently edited this issue—in the initial version, were you using videoid or videoId? Does using videoId fix things?

ronnyroeller commented 9 years ago

@jeffposnick, you are right: It was initially wrong but I corrected the snippet and the screenshots in the ticket. Problem is still there doe.

ronnyroeller commented 9 years ago

I created a Pull Request that fixes this issue: https://github.com/GoogleWebComponents/google-youtube/pull/48

kovacicmilan commented 8 years ago

Is there any update on this?