0 votes
in Methoden-Fragen by s175093 (130 points)

Deutsch: In meiner Studie sollen Porbandinnen eines von drei Videos sehen. Hierfür habe ich im Zufallsgenerator einen HTML Code verwendet. Allerdings haben Probandinnen noch immer die Möglichkeit, das Video vorzuspulen. Leider gelingt es mir nicht den Code so zu ändern, dass dies nicht mehr möglich ist.
Ich würde mich sehr über Hilfe freuen! Danke!

Englisch: In my study, participants should see one of three videos. For this, I used an HTML code in the random number generator. However, subjects still have the option to fast-forward the video. Unfortunately, I am not able to change the code so that this is no longer possible.
I would really appreciate some help! Thank you!

<div id="video-container" style="position: relative;">
    <video width="100%" height="100%" id="stimulus" controls controlsList="nodownload"
           style="video::-webkit-media-controls { display:none !important; }">
        <source src="%random%" type="video/mp4"/>
    </video>
    <div id="video-overlay"
         style="position: absolute; width: 100%; height: 100%; top: 0; left: 0; background-color: #80000000">
        <!--<button type="button" id="play-pause" style="position: absolute; left: 50%">Play</button>
        <div style="border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 20px solid black; height: 0px; left: 50%; margin-left: 10px"></div>
       -->
        <div style="position: absolute; width: 100px; height: 100px; left: 50%; top: 50%; margin-left: -50px; margin-top: -50px">
            <svg width="100px" height="100px">
                <circle cx="50" cy="50" r="40" stroke="#B0FFFFFF" stroke-width="4" fill="#000000"/>
                <polygon points="35,30 75,50 35,70" style="fill:white;"/>
            </svg>
        </div>
    </div>
</div>

<script type="text/javascript">
var video = document.getElementById("stimulus");
var overlay = document.getElementById("video-overlay");

SoSciTools.attachEvent(window, "load", function(evt) {
    SoSciTools.submitButtonsHide();
    
    
    SoSciTools.attachEvent(video , "ended", function(evt) {
        SoSciTools.questionnaire.submit()
    });

    SoSciTools.attachEvent(overlay, "click", function() {
        video.play();  
        //stimulus.controls = false;  
        //stimulus.removeAttribute('controls');
        if (video.requestFullscreen) {
            video.requestFullscreen();
        } else if (video.mozRequestFullScreen) {
            video.mozRequestFullScreen(); // Firefox
        } else if (video.webkitRequestFullscreen) {
           video.webkitRequestFullscreen(); // Chrome and Safari
        }
    });

    SoSciTools.attachEvent(video, "play", function() { 
        overlay.style.visibility = 'hidden';
    });

    SoSciTools.attachEvent(video, "pause", function() { 
        overlay.style.visibility = 'visible';
    });
  
});
</script>

1 Answer

0 votes
by SoSci Survey (304k points)
edited by SoSci Survey

Der Parameter controls in Ihrem <video>-Tag erlaubt die Anzeige der Bedienelemente.

Wenn Sie den HTML-Code aus der Anleitung verwenden (Optimierte Einbindung), dann werden die Bedienelemente nach dem Start des Abspielens ausgeblendet.

// Bedienelemente ausblenden, sobald es abspielt
SoSciTools.attachEvent(video, "play", function(evt) {
  stimulus.removeAttribute("controls");
});

Ihr Script für den Vollbild-Modus können Sie natürlich auch noch ergänzen.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...