Youtube video in popup window full screen

5 posts, 1 answers
  1. Chris
    Chris avatar
    9 posts
    Member since:
    Sep 2012

    Posted 11 Nov 2015 Link to this post

    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

     

     

  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 12 Nov 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chris
    Chris avatar
    9 posts
    Member since:
    Sep 2012

    Posted 12 Nov 2015 in reply to Marin Bratanov Link to this post

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

  5. Chris
    Chris avatar
    9 posts
    Member since:
    Sep 2012

    Posted 20 Nov 2015 Link to this post

    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

  6. Chris
    Chris avatar
    9 posts
    Member since:
    Sep 2012

    Posted 20 Nov 2015 in reply to Chris Link to this post

    As a FYI to others the event 'OnClientBeforeShow' should be used instead of 'OnClientShow'
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017