1

sadly I am an absolute beginner to LaTeX programming. I would like to use a switch case to display embedded YouTube Videos using the package Media9.

\ifcase\value{counterVideogroup1} 
    \includemedia[
        width=0.6\linewidth,
        height=0.3375\linewidth,
        activate=pageopen,
        flashvars={
        modestbranding=1 % no YT logo in control bar
        &autohide=1 % controlbar autohide
        &showinfo=0 % no title and other info before start
        &rel=0 % no related videos after end
        }
    ]{}{http://www.youtube.com/v/SHYevzF-6mM?rel=0}
\or 
    \includemedia[
        width=0.6\linewidth,
        height=0.3375\linewidth,
        activate=pageopen,
        flashvars={
        modestbranding=1 % no YT logo in control bar
        &autohide=1 % controlbar autohide
        &showinfo=0 % no title and other info before start
        &rel=0 % no related videos after end
        }
    ]{}{http://www.youtube.com/v/urhYh2cNgAs?rel=0} 
\else 
    nothing to display
\fi

This works quite well for the counter value 0 but I don't really know how to manipulate the counter to display the other code for the video. I tried to use links but that generates an error message that the file was not found, probably because run indicates a program start.

\href{run:\setcounter{counterVideogroup1}{0}}{Video1}

However I think it would look better if I would use push buttons, but I don't know how to parse my code to set the counter here. I hope you can help me out.

In the end I wasn't able to test whether the code will compile at runtime. So if you see any problems with the switch case here please tell me, too.

Thanks for your time!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.