Issue With Playing Video

12 views
Skip to first unread message

Jordan Axt

unread,
Nov 1, 2021, 6:22:21 AM11/1/21
to Minno.js
Hi All,

I have a study that plays a video clip (clip1_daryani, clip2_daryani). Here is the showfiles page:

The link works well when I test the page itself, but when I test the study on either the mgr file (mgr_JBT_daryani.js) or the expt file (eroy.JBT_daryani.expt.xml), the page does not display properly. I believe there is something wrong with the way I am defining the page in the mgr file. Any chance someone knows what the issue is?

Thanks for your help,
Jordan


--
Jordan Axt

Sapir Keinan

unread,
Nov 1, 2021, 3:35:26 PM11/1/21
to Minno.js
Hi Jordan,

I suggest you lose the separate managers, and instead use the sequences you have for each clip inside the sequence in the main mgr file. In this case, you don't inherit files for each clip in the main sequence, but simply have a message for each video. From my experience, that should work.

I attached an example of similar sequence I used:

API.addSequence([

{inherit: 'txtconsent'},
{inherit: 'warning'},
{inherit: 'tryit'},
{inherit:'intro'},
{inherit:'taskintro'},
{inherit:'nstabAnat3_1'},
{
type: 'message',

data: {
// The video url (as mp4!)
},

// We create the video template itself
template: [
'<div class="text-center">',
' <video controls="controls" autoplay="autoplay" width="854" height="480" style="margin:auto">',
' <source src="<%= tasksData.videoUrl %>" type="video/mp4"/>',
' <object type="application/x-shockwave-flash" data="http://flashfox.googlecode.com/svn/trunk/flashfox.swf" width="640" height="360">',
' <param name="movie" value="http://flashfox.googlecode.com/svn/trunk/flashfox.swf" />',
' <param name="allowFullScreen" value="true" />',
' <param name="wmode" value="transparent" />',
' <param name="flashVars" value="autoplay=true&controls=true&src=<%= tasksData.videoUrl %>" />',
' </object>',
' </video>',
'</div>',
'<div class="text-center proceed" style="margin: 30px auto 10px;">',
' <button pi-message-done type="button" class="btn btn-primary">Click Here to Proceed</button>',
'</div>'
].join('\n'),


// This is where the magic happens. as soon as the page is loaded
// We hide The proceed button, and show it only after 60 seconds when the video is supposed to end.
// (Note that in certain situations the button may be displayed before the video finishes playing. This is because the timing is absolute and not dependant on the video actually finishing)
load: function(){
var proceed = document.querySelectorAll('.proceed')[0];
proceed.style.visibility = 'hidden';
setTimeout(function(){
proceed.style.visibility = '';
}, 56 * 1000); // after 55 seconds
}

},
{inherit:'postquesgame'},
{inherit:'debriefing'},
{inherit: 'redirect'}
]);

Hope this helps,
Sapir
ב-יום שני, 1 בנובמבר 2021 בשעה 12:22:21 UTC+2, jorda...@gmail.com כתב/ה:

Jordan Axt

unread,
Nov 3, 2021, 10:38:50 AM11/3/21
to Sapir Keinan, Minno.js
Hi Sapir,

Yep, that works great! Thanks a lot for the help.

Jordan

--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/18762a2e-bf0e-42bc-8682-6d639a114febn%40googlegroups.com.


--
Jordan Axt
Reply all
Reply to author
Forward
0 new messages