Embedded YouTube Video in News post won't show in News Widget
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&autoplay=1&wmode=transparent"></iframe>
Any suggestions?
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
>
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.
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
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.
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
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.
Hi guys,
Please check the attached file where you can find the modified selector compatible with 6.x.
Regards,
Kaloyan
Telerik
Hi,
I have faced the same issue after upgraded to 9.1 n development environment, when we logged into backend , the page loading with some extra js scripts, so the iframe used in youtube are not loading properly, Once we logged out from back and and viewed the same page, the iframe will load youtube.
Thanks
Nazer