Tuesday, 15 July 2014

Force a user to watch the whole video -


I find that forces the user to watch the entire video, and at the end of each video there would be a small button A javascript function that triggers any video or reader thanks

I have a similar concept Wanted to apply and i tried to ask for help but i did not get the jquery dome manipulation And the following is the code applied to it:

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "http://www.youtube.com/player_api" & gt; & Lt; / Script & gt; & Lt; Script src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "youtubevideo" & gt; & Lt; / Div & gt; & Lt; Script & gt; // Create player var youtubevideo; Function onYouTubePlayerAPIReady () {youtubevideo = new YT.Player ('youtubevideo', {height: '390', width: '640', Video ID: 'HS5 CFP 8 N_GE', // Video autoplay here, player to keyboard Hide and Disable Keyboard Prevent users from running the video. NB: Autoplay only works on PCs iOS 8 also compels basic controls Player Wars: {'rel': 0, 'showinfo' : 0, 'Autoplay': 1, 'control': 0, 'Disablekb': 1, 'Modest branding': 1}, Event: {'On 'Change Onpleyr Reedi "Onstet' Onpleyrstet change}}); }player read (event) on function {event.target.playVideo (); } // It tells the YouTube player to trigger the Hello () function while functioning on the PlainState Change (Event) {if (event.data === 0) {hello (); }} // hello function uses ajax to fetch html after the video ends. This jquery DOM manupulation function Hello () {var i = 'html goes here'; $ ("Body"). Html (i)} & lt; / Script & gt; & Lt; / Body & lt; Html & gt; You can see it here: 

You can apply it to many players, I have used YouTube as an example.


No comments:

Post a Comment