+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Embedded YouTube Video in News post won't show in News Widget

Embedded YouTube Video in News post won't show in News Widget

8 posts, 0 answered
  1. Thom
    Thom avatar
    11 posts
    Registered:
    05 Sep 2013
    23 Sep 2013
    Link to this post
    I am running 6.1 and I have embedded a YouTube video in a News item and it plays fine when you follow the link to the news item, but it won't show in the News content block that's referencing it no matter what size I make the frame for the video.

    Code in News item:

    <iframe width="640" height="480" frameborder="0" src="//www.youtube.com/embed/XXXXXXXXX?rel=0&amp;autoplay=1&amp;wmode=transparent"></iframe>

    Any suggestions?
  2. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    23 Sep 2013 in reply to Thom
    Link to this post
    Hey Thom,

    Both an iframe dropin should work on the backend widget and the front-end rendering. This is what YouTube currently suggests:

    <iframe
      width="420"
      height="315"
      src="//www.youtube.com/embed/KbteHzlt8lA"
      frameborder="0"
      allowfullscreen>
    </iframe>

    So not sure if I understand your problem correctly, but have you verified that the Sitefinity editor doesn't strip and/or mangle your pasted html snippet?

    Jochem.
  3. Thom
    Thom avatar
    11 posts
    Registered:
    05 Sep 2013
    01 Oct 2013
    Link to this post
    Yeah, I'm definitely not seeing any reference to youtube when I inspect the element.  

    I can see that it references the /images/play_button.png like it thinks it's supposed to be able to kick off a video, but you can't actually see the play_button on the rendered page and it doesn't recognize it as an active link.
  4. Jochem Bökkers
    Jochem Bökkers avatar
    787 posts
    Registered:
    13 Aug 2007
    01 Oct 2013 in reply to Thom
    Link to this post
    Hey Thom,

    You should see several references to ytimg.com, youtube.com references only happen after you've actually clicked on the play button and it tries to play the video. Have you checked for any other errors than the crossdomain reference?

    ---
    Not sure where/how you're seeing an /images/play_button.png. If you drop that snippet from the previous post onto your news content block, you end up with an iframe source code like in the 2nd image attached. As you can see it's flash... 

    Jochem
  5. Thom
    Thom avatar
    11 posts
    Registered:
    05 Sep 2013
    10 Oct 2013
    Link to this post
    Tracked this down to an override of the SimpleImageField class Value object based on a Sitefintity example and in this code:

            public override object Value
            {
                get
                {
                    var val = string.Empty;
                    switch (this.DisplayMode)
                    {
                        case FieldDisplayMode.Read:
                            val = this.ImageControl.ImageUrl;
                            break;
                        case FieldDisplayMode.Write:
                            val = this.TextBoxControl.Text;
                            break;
                    }
                    return val;
                }
                set
                {
                    if (this.ChildControlsCreated)
                    {
                        var imageId = new Guid(value as string);
                        var img = App.WorkWith().Image(imageId).Get();
                        _imageUrl = img.MediaUrl;
                        _thumbnailUrl = img.ThumbnailUrl;
                        SetImageUrl();
                        if (DisplayMode == FieldDisplayMode.Write)
                            TextBoxControl.Text = value as string;
                        base.Value = null;
                    }
                    else
                    {
                        base.Value = value;
                    }
                }
            }

    during the set, "if (this.ChildControlsCreated)"  always fails.  

    Apparently, this was not an issue before the upgrade to 6.1, but not sure where to go from here.
  6. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    05 Dec 2016
    15 Oct 2013
    Link to this post
    Hello guys,

    @Thom
    I have tried to embed Youtube video in a news item and there is no problem on my side. I have recorded a short video to demonstrate the behaviour on  my project.

    http://screencast.com/t/dZg42Tdo

    If your approach is different, feel free to correct me.

    Regards,
    Kaloyan
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Thom
    Thom avatar
    11 posts
    Registered:
    05 Sep 2013
    15 Oct 2013
    Link to this post
    I haven't implemented it yet because I have some merging to work out, but this is the answer from Support:

    In version 6.0 we have introduced Hierarchical libraries and this is the reason why this sample could not work as expected. Please check the attached file where you can find modified sample which is compatible with 6.x projects. Using the modified sample there should be no problems with this functionality.

    I can't attach the file because it doesn't like something about the zip file even after I cut it down to 22k. If anyone has run into the same problem I am having and needs the solution, maybe you can contact support to get the ThumbnailSelectorField.zip file that was sent to me.
  8. Kaloyan
    Kaloyan avatar
    272 posts
    Registered:
    05 Dec 2016
    16 Oct 2013
    Link to this post
    Hi guys,

    Please check the attached file where you can find the modified selector compatible with 6.x.

    Regards,
    Kaloyan
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
8 posts, 0 answered