Jump to content

Recommended Posts

Posted (edited)

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- #
Posted

The example is pretty self explanatory.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted (edited)

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()
Posted

Theres a few sites that use avi/divx for movie/series streaming, But best not get into that here. Its not so legal.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

None of them worked for me. Thus.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

I never said it wasnt possible, But all the ones I tried, didnt work with any of my avi files from eztv.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

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
  • Recently Browsing   0 members

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