function restart_video(req, res, offset) {
  var userId = req.userId;

  // Generate new token
  last_token[userId] = uuidv4();

  // Replay the last searched audio back into Alexa
  res.audioPlayerPlayStream("REPLACE_ALL", {
    url: last_search[userId],
    streamFormat: "AUDIO_MPEG",
    token: last_token[userId],
    offsetInMilliseconds: offset
  });

  // Record playback start time
  if (!last_playback.hasOwnProperty(userId)) {
    last_playback[userId] = {};
  }
  last_playback[userId].start = new Date().getTime();
}
/**
 * Restarts the video by injecting the last search URL as a new stream.
 *
 * @param  {Object} res    A response that will be sent to the Alexa device
 * @param  {Number} offset How many milliseconds from the video start to begin at
 */
Restarts the video by injecting the last search URL as a new stream.
@param  {Object} res    A response that will be sent to the Alexa device
@param  {Number} offset How many milliseconds from the video start to begin at
Restarts the video by injecting the last search URL as a new stream . @param { Object } res A response that will be sent to the Alexa device @param { Number } offset How many milliseconds from the video start to begin at
function restart_video(req, res, offset) {
  var userId = req.userId;
  last_token[userId] = uuidv4();
  res.audioPlayerPlayStream("REPLACE_ALL", {
    url: last_search[userId],
    streamFormat: "AUDIO_MPEG",
    token: last_token[userId],
    offsetInMilliseconds: offset
  });
  if (!last_playback.hasOwnProperty(userId)) {
    last_playback[userId] = {};
  }
  last_playback[userId].start = new Date().getTime();
}
function restart_video ( req , res , offset ) { var userId = req . userId ; last_token [ userId ] = uuidv4 ( ) ; res . audioPlayerPlayStream ( "REPLACE_ALL" , { url : last_search [ userId ] , streamFormat : "AUDIO_MPEG" , token : last_token [ userId ] , offsetInMilliseconds : offset } ) ; if ( ! last_playback . hasOwnProperty ( userId ) ) { last_playback [ userId ] = { } ; } last_playback [ userId ] . start = new Date ( ) . getTime ( ) ; }
Restarts the video by injecting the last search URL as a new stream.
Restarts the video by injecting the last search URL as a new stream .
// Generate new token // Replay the last searched audio back into Alexa // Record playback start time