Step by step functionality in video

  1. last year

    Hello,
    I am new to Swift and I need some directions, hopefuly someone here will be able to help me. I have an app that plays Taekwon-do pattern ( sequence of punches/blocks/kicks) and I need to display name of every movement while it's playing. I have an array of times when movement is performed and I have an array of the names of movements. I need something like this (it's not Swift code, just a general idea ;) ):

    time_array = [1,23; 2,5; 4,5];
    movements_array[1,23] = 'First movement';
    movements_array[2,5] = 'Second movement';
    ...
    if(current_time_of_the_video == one_of_the_times_in_array)
    displayNameOfTheMovement(movements_array[one_of_the_times_in_array);


    I've created this app in Adobe AIR, using flv files and cuePoints, but I guess I need a new approach here...
    Is there a listener that would check the current video time and compare it to the time in array? Or maybe a function that would play from one point to another and do it in a loop, so it would play constantly.
    I mean:

    playVIdeo(from one point, to the next one);
    for(i=0; i<number_of_times;i++)
    {
    play from 0s to 1,23s; //time_array[i] to time_array[i+1];
    displayNameOfTheMovement(movements_array[time_array[i+1);
    }


    Anny suggestions will be appreciated!
    Thank you in advance!

or Sign Up to reply!