How to automatically present a video in Full Screen mode | XM Community
Skip to main content
Question

How to automatically present a video in Full Screen mode

  • 6 November 2019
  • 7 replies
  • 350 views

Hi there, I am putting together an experiment that requires participants to watch a video that must be viewed in Full Screen mode. I Have tried inserting some of the java/HTML code that has been previously posted on this subject but to no avail. I am not sure if I am inserting it in the correct place or whether the code does not work! Can anyone help??? Thanks a million in advance... Luke

7 replies

Igee
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 26 replies
  • November 6, 2019
hi @Luke_may001 - Can you paste the JS code you are using? you would need to paste the JS code within the "addOnload" function. Also have you provided your iFrame with an id?

  • Author
  • 4 replies
  • November 7, 2019
Hi Igee, thanks a lot for getting back to me,

this is one of the scripts i tried:

function goFullscreen(id) {
var element = document.getElementById(id);

if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullScreen) {
element.webkitRequestFullScreen();
}
}

<img class="video_player" src="image.jpg" id="player"></img>
<button onclick="goFullscreen('player'); return false">Fullscreen</button>

This the screen I have entered it into, but i was not sure where to enter it or whether to delete what was already there...
!

  • Author
  • 4 replies
  • November 7, 2019
I just tried adding the javascript to within the "addonload" section and it came up with:!

Igee
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 26 replies
  • November 7, 2019
hey @Luke_may001 - You get the error cause you are trying to use a "<" however, in order to use a "<" tag you would need to use jQuery. I see you are using something along the lines of <img class, (not able to see more of the code due to the Alert pop-up so I am unsure what is that for?

Are you using an iFrame to embed your video into Qualtrics or have you uploaded the video from your local machine?

Igee
QPN Level 2 ●●
Forum|alt.badge.img+1
  • QPN Level 2 ●●
  • 26 replies
  • November 7, 2019
@Luke_may001 - If you are using an iFrame this is possible by giving your iframe a particular id eg: "iframe1" as highlighted below under Iframe Properties > Advanced

!

Once you have assigned an id, you can then use the below JS code for that question, under the "addonload" function.

!

  • Author
  • 4 replies
  • November 11, 2019
Hi Igee, thanks for getting back to me again! I uploaded the video directly from my drive so not iframe, do you have any script for that situation?

  • Author
  • 4 replies
  • November 14, 2019
Hi Igee, are you able to help with this or should i try reposting the question?
thanks,
Luke

Leave a Reply