Help to control fullscreen (on/off) of the media player plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • fcc
    Forum Member
    • Feb 2004
    • 29

    Help to control fullscreen (on/off) of the media player plugin

    Hello,
    I try to control the fullscreen without pressing the esc key.

    in others post, I read that the only way is pressing the esc Key, for this reason, I have tried to use KEYSTROKES.DLL for simulate the esc Key (using Enter e_Key == 13).

    here the code (Page1):
    On Show Event
    ---------------------------------------------------------------------------------
    MediaPlayer.Load("VideoPlugin1", _SourceFolder.."\\AutoPlay\\Videos\\Anillos.mp4");
    MovieLoaded = true;

    if(MovieLoaded == true)then
    MediaPlayer.Play("VideoPlugin1");
    MediaPlayer.SetFullScreen("VideoPlugin1",true);
    MovieFullScreen = true;
    else
    Dialog.Message("Load Movie Error","Presiona Alt + F4 para abortar");
    end
    ---------------------------------------------------------------------------------
    On Key Event
    ---------------------------------------------------------------------------------
    if e_Key == 13 then
    if MovieFullScreen == true then
    Page.SetFocus("VideoPlugin1");
    Key="{ESC}";
    dllresult = DLL.CallFunction (_SourceFolder.."\\AutoPlay\\Docs\\KEYSTROKES.DLL" , "KeyStroke", "\""..Key.."\"", DLL_RETURN_TYPE_INTEGER, DLL_CALL_STDCALL);

    MovieFullScreen = false;
    else
    MediaPlayer.SetFullScreen("VideoPlugin1",true);
    MovieFullScreen = true;
    end
    end
    ---------------------------------------------------------------------------------


    the code for mediaplayer (VideoPlugin1):
    On Play Event
    ---------------------------------------------------------------------------------
    Plugin.SetVisible(this, true);
    Page.SetFocus("Page1");
    ---------------------------------------------------------------------------------


    I do not know what is the problem
    any help will be appreciated.

    Thanks
  • fcc
    Forum Member
    • Feb 2004
    • 29

    #2
    I found the solution, the problem was the focus.


    the new code is :

    (Page1)
    the On Key Event
    ------------------------------------------------------------------------------
    if e_Key == 13 then
    if MovieFullScreen == true then
    Page.SetFocus("VideoPlugin1");
    MovieFullScreen = false;
    MediaPlayer.SetFullScreen("VideoPlugin1",false);
    Page.SetFocus("Page1");
    else
    Page.SetFocus("VideoPlugin1");
    MovieFullScreen = true;
    MediaPlayer.SetFullScreen("VideoPlugin1",true);
    Page.SetFocus("Page1");
    end
    end
    -------------------------------------------------------------------------------

    without using DLL, the rest of the code is the same.

    :

    Comment

    Working...
    X