Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • malar 97 posts 206 karma points
    Oct 02, 2017 @ 17:54
    malar
    0

    Hello Team,

    My video is on autoplay mode .I need to stop autoplay . I am using iframe in the body text. How can I do ? Can you please help me.

    This is my link:

    http://deo.dk/eu-nyt/nyheder/2017/den-sorte-industri-staar-fortsat-staerkest-paa-den-politiske-scene/

    My iframe code

    iframe src ="" allowfullscreen="" width="450" height="300" frameborder="0" autoplay="0"

  • Jakob Nielsen 4 posts 74 karma points
    Oct 02, 2017 @ 18:46
    Jakob Nielsen
    0

    Hi Malar. This is only related to your html so not really an umbraco issue, but try to remove the autoplay property

    <video controls="" autoplay="" name="media"></video>
    

    should be

        <video controls="" name="media"></video>
    
  • malar 97 posts 206 karma points
    Oct 02, 2017 @ 20:41
    malar
    0

    If i am using video tag in html body text ,It is not displaying video , it says, Your browser does not support the video tag. Therfore i am using iframe tag , if i am using iframe tag , automitaclly autoplay is on. I did not write autoplay property in iframe tag.

  • Jakob Nielsen 4 posts 74 karma points
    Oct 02, 2017 @ 20:57
    Jakob Nielsen
    0

    That sounds very weird to me. that you are not able to play the video unless in an iframe. Which browser do you experience the issue in, and have you tried different codecs , and formats for the video ?

  • malar 97 posts 206 karma points
    Oct 04, 2017 @ 08:36
    malar
    0

    I checked google chrome, firefox. I tried many ways , it is not working.

  • malar 97 posts 206 karma points
    Oct 04, 2017 @ 09:00
    malar
    0

    See i wrote i frame tag but in my source code , it is displaying , i frame and video tag . how it is possible . Can you please help me.

    This is my link: http://deo.dk/eu-nyt/nyheder/2017/den-sorte-industri-staar-fortsat-staerkest-paa-den-politiske-scene/

  • malar 97 posts 206 karma points
    Oct 05, 2017 @ 08:10
    malar
    0

    Can you please help me.

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Oct 05, 2017 @ 09:13
    Alex Skrypnyk
    0

    Hi Malar

    I see only iframe tag and autoplay is working fine.

    Thanks,

    Alex

  • malar 97 posts 206 karma points
    Oct 05, 2017 @ 09:17
    malar
    0

    Hi,

    I dont want to work autoplay

  • Jakob Nielsen 4 posts 74 karma points
    Oct 05, 2017 @ 09:38
    Jakob Nielsen
    1

    Hi Malar. The video is playing because you put it in an iframe and the browser guesses that this is what you want. If you are using latest version of the browser it should work with the normal video tag. please take a look at my example here https://codepen.io/jitterbugboy/pen/EwoyjK If this does not work in your browsers you are probably missing a video codec to play the mp4 files. -however that seems unlikely since you can play the iframe - anyway give it a try and try to paste the code ion your page as well

  • malar 97 posts 206 karma points
    Oct 12, 2017 @ 11:29
    malar
    0

    Hi Jakob,

    Just i downloaded umbraco vision 4.11.10. I installed in local server. The site is working fine . But i cant add video tag in body text. I can add only iframe tag. Why i can not add video tag. enter image description here

  • Martin Aguirre 42 posts 210 karma points
    Oct 12, 2017 @ 11:54
    Martin Aguirre
    0

    Hi Maybe you can use javascript. In the following code there are some lines that pause video element in a modal. (I put the whole function to clarify)

    <script>
        $(document).ready(function () {
    
                function setCookie(name, value) {
                    document.cookie = name + "=" + value + "; path=/";
                }
                function detectmob() {
                    if (navigator.userAgent.match(/Android/i)
                    || navigator.userAgent.match(/webOS/i)
                    || navigator.userAgent.match(/iPhone/i)
                    || navigator.userAgent.match(/iPad/i)
                    || navigator.userAgent.match(/iPod/i)
                    || navigator.userAgent.match(/BlackBerry/i)
                    || navigator.userAgent.match(/Windows Phone/i)
                    ) {
                        return true;
                    }
                    else {
                        return false;
                    }
                }
    
                function hasCookie(cname) {
                    var name = cname + "=";
                    var ca = document.cookie.split(';');
                    for (var i = 0; i < ca.length; i++) {
                        var c = ca[i];
                        while (c.charAt(0) == ' ') {
                            c = c.substring(1);
                        }
                        if (c.indexOf(name) == 0) {
                            return true;
                        }
                    }
                    return false;
                }
    
                var prepend = location.pathname.replace(/\//g, "_");
                var mediaId = "@(MediaId)";
            var advertisementName = prepend + "__" + mediaId + "__advertisement";
          @*  if (!detectmob()) *@
    
                if (!hasCookie(advertisementName)) {    
                    setCookie(advertisementName, "true");
                    $("#advertisement").modal();
                                                    } // tiene cookie
                    else
                    {                       
                        $(this).find('video')[0].pause();               
                    }
        @*    } // mob  *@
    
    
                    $(function(){
        $('#advertisement').modal({
            show: false
        }).on('hidden.bs.modal', function(){
            $(this).find('video')[0].pause();
        });
    });
    
    
    
        });
    </script>
    
Please Sign in or register to post replies

Write your reply to:

Draft