Results 1 to 4 of 4

Thread: Stop a video when changing timelines

  1. #1
    Sencha User
    Join Date
    Jul 2013
    Posts
    5
    Vote Rating
    0
      0  

    Default Stop a video when changing timelines

    Is there a way to have a video stop playing when you switch timelines?

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    304
    Vote Rating
    28
      0  

    Default

    Hi aerica,

    Yes you can, with a little of Javascript. On your event that changes the timeline you should set the custom JS to something like:
    Code:
    //substitute myVideoId with the id of your video element
    var video = document.getElementById('myVideoId');
    video.pause();
    //substitute myTimelineName by the name of your timeline
    controller.goToTimelineByName('myTimelineName');
    Along these, you can also use video.play(); to resume playing the video or video.currentTime = myTime; to set the position or rewind the video.

    Hope it helps.

  3. #3
    Sencha User
    Join Date
    Jul 2013
    Posts
    5
    Vote Rating
    0
      0  

    Default

    awesome, thank you for the response!

  4. #4
    Sencha User
    Join Date
    May 2015
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by miro.bojic View Post
    Hi aerica,

    Yes you can, with a little of Javascript. On your event that changes the timeline you should set the custom JS to something like:
    Code:
    //substitute myVideoId with the id of your video element
    var video = document.getElementById('myVideoId');
    video.pause();
    //substitute myTimelineName by the name of your timeline
    controller.goToTimelineByName('myTimelineName');
    Along these, you can also use video.play(); to resume playing the video or video.currentTime = myTime; to set the position or rewind the video.

    Hope it helps.

    is there any method we can get currentTime of timeline to set the position to our time we want?
    like i have something but it didn't work out.
    Code:
    tl=controller.getCurrentTimeline();
    tl.currentTime=myTime
    please help me in this...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •