This is a migrated thread and some comments may be shown as answers.

Youtube video in popup window full screen

4 Answers 157 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 11 Nov 2015, 07:23 PM

Hi,

I want to embed the following HTML into a popup window, but I am unable to watch it fullscreen:

<iframe width="560" height="315" src="https://www.youtube.com/embed/sNIMCdVOHOM" frameborder="0" allowfullscreen></iframe>

This is due to internally telerik generates a window by using an iframe to load the content into, this iframe is missing the "allowfullscreen" attribute therefore the browser does not allow full screen.

How can I add an attribute to the iframe internally generated by telerik?

Chris

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 12 Nov 2015, 08:25 AM

Hi Chris,

You can get the iframe in the OnClientShow event (http://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/events/onclientshow) through the get_contentFrame() method (http://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/radwindow-object). Here is a basic example:

<telerik:RadWindow ID="RadWindow1" runat="server" OnClientShow="setIframeAttr" VisibleOnPageLoad="true"></telerik:RadWindow>
<script>
    function setIframeAttr(sender, args) {
        var frame = sender.get_contentFrame();
        if (frame) {
            frame.setAttribute("allowfullscreen", "true");
        }
    }
</script>


Regards,

Marin Bratanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 12 Nov 2015, 12:25 PM

Thanks, I must have completely missed this option in the documentation.

0
Chris
Top achievements
Rank 1
answered on 21 Nov 2015, 05:25 AM

I have just found out annoyingly this does not work in the latest version of internet explorer, well only if you re-load the popup page on first load.

Chris

0
Chris
Top achievements
Rank 1
answered on 21 Nov 2015, 05:29 AM
As a FYI to others the event 'OnClientBeforeShow' should be used instead of 'OnClientShow'
Tags
Window
Asked by
Chris
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Chris
Top achievements
Rank 1
Share this question
or