Jump to content

DivX Web Player UDF


AzKay
 Share

Recommended Posts

Needed: DivX Web Player

DivX.au3

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.13.7 (beta)
 Author:         AzKay

 Script Function:
    DivX Web Player UDF

#ce ----------------------------------------------------------------------------

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#include-once

Func _DivX_Create($sDivXTitle, $iX, $iY, $iWidth, $iHeight, $pContextMenu = 1, $pMode = "mini")
    If Not IsObj(ObjCreate("npdivx.DivXBrowserPlugin.1")) Then
        SetError(-1, "DivX Plugin not installed")
        Return -1
    EndIf
    Local $oDivX, $aRet[2]
    $oDivX = ObjCreate("npdivx.DivXBrowserPlugin.1")
    $hDivX_ctrl = GUICtrlCreateObj($oDivX, $iX, $iY, $iWidth, $iHeight)
    $oDivX.SetMovieTitle($sDivXTitle)
    $oDivX.SetAllowContextMenu($pContextMenu)
    $oDivX.SetMode($pMode)
    $aRet[0] = $oDivX
    $aRet[1] = $hDivX_ctrl
    Return $aRet
EndFunc

Func _DivX_Close($oDivX, $hDivX)
    If Not IsObj($oDivX) Then
        SetError(-1, "Invalid DivX Object")
        Return -1
    EndIf
    If Not IsHWnd($hDivX) Then
        SetError(-2, "Invalid hWnd")
        Return -2
    EndIf
    $oDivX.Stop
    GUICtrlDelete($hDivX)
    Global $oDivX = ""
EndFunc

Func _DivX_Resize($hDivX, $oDivX, $iX, $iY, $iWidth, $iHeight)
    If Not IsObj($oDivX) Then
        SetError(-1, "Invalid DivX Object")
        Return -1
    EndIf
    If Not IsHWnd($hDivX) Then
        SetError(-2, "Invalid hWnd")
        Return -2
    EndIf
    GUICtrlSetPos($hDivX, $iX, $iY, $iWidth, $iHeight)
    $oDivX.Resize($iWidth, $iHeight)
    Return 1
EndFunc

Func _DivX_GetProperty($oDivX, $pProperty)
    If Not IsObj($oDivX) Then
        SetError(-1, "Invalid DivX Object")
        Return -1
    EndIf
    Switch $pProperty
        Case "Width"
            $sRet = $oDivX.GetVideoWidth
        Case "Height"
            $sRet = $oDivX.GetVideoHeight
        Case "Length"
            $sRet = $oDivX.GetTotalTime
        Case "Frames"
            $sRet = $oDivX.GetTotalVideoFrames
        Case "FrameRate"
            $sRet = $oDivX.GetVideoFrameRate
        Case Else
            SetError(-2, "Invalid Property")
            Return -2
    EndSwitch
    Return $sRet
EndFunc

Func _DivX_Command($oDivX, $pCommand, $pParam = "")
    If Not IsObj($oDivX) Then
        SetError(-1, "Invalid DivX Object")
        Return -1
    EndIf
    Switch $pCommand
        Case "Open"
            $oDivX.Open($pParam)
        Case "AutoPlay"
            $oDivX.SetAutoPlay($pParam)
        Case "Play"
            $oDivX.Play
        Case "Stop"
            $oDivX.Stop
        Case "Pause"
            $oDivX.Pause
        Case "FF"
            $oDivX.FF
        Case "RW"
            $oDivX.RW
        Case "StepBackward"
            $oDivX.StepBackward
        Case "StepForward"
            $oDivX.StepForward
        Case "Seek"
            $oDivX.Seek("DRAG", $pParam)
        Case "Volume"
            $oDivX.SetVolume($pParam)
        Case "Mute"
            $oDivX.Mute
        Case "UnMute"
            $oDivX.UnMute
        Case "FullScreen"
            $oDivX.GoFullscreen
        Case "Window"
            $oDivX.GoWindowed
        Case "Embed"
            $oDivX.GoEmbedded
        Case "Loop"
            $oDivX.SetLoop($pParam)
        Case "UI"
            $oDivX.SetMode($pParam)
        Case "BufferMode"
            $oDivX.SetBufferingMode($pParam)
        Case "ContextMenu"
            $oDivX.SetAllowContextMenu($pParam)
        Case "ShowContextMenu"
            $oDivX.ShowContextMenu
        Case "ShowPreferences"
            $oDivX.ShowPreferences
        Case "MovieTitle"
            $oDivX.SetMovieTitle($pParam)
        Case "PreviewImage"
            $oDivX.SetPreviewImage($pParam)
        Case "PreviewText"
            $oDivX.SetPreviewMessage($pParam)
        Case "PreviewTextFontSize"
            $oDivX.SetPreviewMessageFontSize($pParam)
        Case Else
            SetError(-2, "Invalid Command")
            Return -2
    EndSwitch
    Return 1
EndFunc

I havnt done any testing, save the example code.

So, any problems/solutions/reports will be appreciated.

Ill post more descriptions for each function when I wake up, But thats the basics there.

Some things I cant get working right, like SetAutoPlayer, SetPreviewImage, etc. So, Ill have to look at them when I get up.

Keep me posted ;o

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Link to comment
Share on other sites

Since Stage6 went down, I don't know how much use DivX is anymore. Most Flash-based websites can offer high quality streaming :)

I guess it all depends, seems like DivX Webplayer can play additional formats (avi/divx) that flash can't.

Edited by Kastout
Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
Link to comment
Share on other sites

None of them worked for me. Thus.

I use mcisendstring for videos in EMP so it is possible, you only have to find the right udf (or create it yourself) Edited by AdmiralAlkex
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...