Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <!-- Vidyard inline embed code -->
  6. <script type="text/javascript" id="vidyard_embed_code_hedIuHeKRKySm1qx9xXV7w" src="//play.vidyard.com/hedIuHeKRKySm1qx9xXV7w.js?v=3.1&type=inline"></script>
  7. <script src="//play.vidyard.com/v0/api.js"></script>
  8. <script type="text/javascript">
  9. // Parsing the query string
  10. function get_parameter_by_name(name) {
  11. name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  12. var regexS = "[\\?&]" + name + "=([^&#]*)";
  13. var regex = new RegExp(regexS);
  14. var results = regex.exec(window.location.search);
  15. if (results == null) {
  16. return "";
  17. } else {
  18. return results[1];
  19. }
  20. }
  21.  
  22. // Get the number of seconds from the query string using "vytime" as the parameter
  23. var urlParam = get_parameter_by_name("vytime");
  24. var playerTime = Number(urlParam);
  25.  
  26. // If the vytime parameter is present, start the video automatically and jump to the time.
  27. function timeCheck() {
  28. if (playerTime > 0) {
  29. // Use the player API to start the player and jump to a specific time.
  30. var videos = new Vidyard.players();
  31. videos["hedIuHeKRKySm1qx9xXV7w"].on("ready",function (){
  32. videos["hedIuHeKRKySm1qx9xXV7w"].play();
  33. });
  34. videos["hedIuHeKRKySm1qx9xXV7w"].on("play",function () {
  35. videos["hedIuHeKRKySm1qx9xXV7w"].seek(playerTime);
  36. playerTime = null;
  37. });
  38. }
  39. }
  40. window.onload = timeCheck();
  41. </script>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement