Video Player mit Wiedergabeliste

  • Hey leute,

    ich habe mir ein kleines Programm gemacht mit dem ich ganz einfach Links von z.B YouTube abspielen kann das ganze geht über eine config.
    Nur mein prob ist jetzt das die Links nicht nacheinander abgespielt werden sondern nur das wo momentan makiert ist...
    Es gibt doch bestimmt eine möglichkeit es so zu machen oder?

    Hier mal der Code
    was jetzt auch noch ist bei der neuen Version von AutoIt funktioniert dieser nicht mehr...

    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    $Form1 = GUICreate("Video Stream Player by Michi2q", 306, 421, 193, 139)
    $RadioBox = GUICtrlCreateCombo("", 15, 130, 270, 15, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL))
    GUISetBkColor(0xABABAB)
    $Group1 = GUICtrlCreateGroup("Player", 8, 8, 289, 89)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    $play = GUICtrlCreateButton("Abspielen", 16, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $stop = GUICtrlCreateButton("Stopp", 96, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $lauter = GUICtrlCreateButton("Lauter", 16, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $low = GUICtrlCreateButton("Leiser", 96, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Mute = GUICtrlCreateButton("Ton aus", 176, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Button6 = GUICtrlCreateButton("Links eintragen", 176, 32, 83, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Playliste", 8, 104, 289, 305)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ;GUICtrlSetState(-1, $GUI_DISABLE)
    ; INET BEFEHLE
    $oIE = _IECreateEmbedded ()
    GUICtrlCreateObj($oIE, -30, -30, 0, 0)

    [/autoit][autoit][/autoit][autoit]

    ; Inet Load
    If not FileExists("Stream.urls") Then
    MsgBox(16, "Radio-Streamer", "Die URL Liste Existiert Nicht!")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    Else
    $Liste = ""
    $Sections = IniReadSection("Stream.urls", "Sender")
    For $i = 1 to $Sections[0][0]
    $Liste &= $Sections[$i][0] & "|"
    Next
    GUICtrlSetData($RadioBox, $Liste)

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    EndIf

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Mute
    Send("{VOLUME_MUTE}")
    Case $low
    Send("{VOLUME_DOWN}")
    Case $lauter
    Send("{VOLUME_UP}")

    [/autoit][autoit][/autoit][autoit]

    ; Musik Abspielen

    [/autoit][autoit][/autoit][autoit]

    Case $play
    If not GUICtrlRead($RadioBox) = "" Then
    $sSender = IniRead("Stream.urls", "Sender", GUICtrlRead($RadioBox), "")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($stop, $GUI_ENABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    _IENavigate($oIE, $sSender)

    [/autoit][autoit][/autoit][autoit]

    EndIf
    Case $stop
    _IENavigate($oIE, "about:blank")
    GUICtrlSetState($play, $GUI_ENABLE)
    GUICtrlSetState($stop, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_ENABLE)

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]
  • Hallo,


    Ich glaube du hast vergessen den button zum "link eintragen" einen befehl unterzuordenen ;D

  • Hallo Zero2q,

    Zitat von Zero2q

    Nur mein prob ist jetzt das die Links nicht nacheinander abgespielt werden sondern nur das wo momentan makiert ist...
    Es gibt doch bestimmt eine möglichkeit es so zu machen oder?

    ich kenne keine Möglichkeit, wie man feststellen kann, ob ein Lied zu Ende gespielt ist. Wenn du eine findest würde es so funktionieren:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #Include <GuiComboBox.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $sSender

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Video Stream Player by Michi2q", 306, 421, 193, 139)
    $RadioBox = GUICtrlCreateCombo("", 15, 130, 270, 15, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
    GUISetBkColor(0xABABAB)
    $Group1 = GUICtrlCreateGroup("Player", 8, 8, 289, 89)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    $play = GUICtrlCreateButton("Abspielen", 16, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $stop = GUICtrlCreateButton("Stopp", 96, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $lauter = GUICtrlCreateButton("Lauter", 16, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $low = GUICtrlCreateButton("Leiser", 96, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Mute = GUICtrlCreateButton("Ton aus", 176, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Button6 = GUICtrlCreateButton("Links eintragen", 176, 32, 83, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Playliste", 8, 104, 289, 305)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;GUICtrlSetState(-1, $GUI_DISABLE)
    ; INET BEFEHLE
    $oIE = _IECreateEmbedded()
    GUICtrlCreateObj($oIE, -30, -30, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Inet Load
    If Not FileExists("Stream.urls") Then
    MsgBox(16, "Radio-Streamer", "Die URL Liste Existiert Nicht!")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    Else
    $Liste = ""
    $Sections = IniReadSection("Stream.urls", "Sender")
    For $i = 1 To $Sections[0][0]
    $Liste &= $Sections[$i][0] & "|"
    Next
    GUICtrlSetData($RadioBox, $Liste)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Mute
    Send("{VOLUME_MUTE}")
    Case $low
    Send("{VOLUME_DOWN}")
    Case $lauter
    Send("{VOLUME_UP}")

    [/autoit] [autoit][/autoit] [autoit]

    ; Musik Abspielen

    [/autoit] [autoit][/autoit] [autoit]

    Case $play
    If Not GUICtrlRead($RadioBox) = "" Then
    Do
    $sOld = $sSender
    $sSender = IniRead("Stream.urls", "Sender", GUICtrlRead($RadioBox), "")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($stop, $GUI_ENABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    ;_IENavigate($oIE, $sSender)
    ConsoleWrite($sSender & @CRLF)
    Sleep(500)
    _GUICtrlComboBox_SetCurSel($RadioBox, _GUICtrlComboBox_GetCurSel($RadioBox)+1)
    Until $sOld = $sSender
    EndIf
    Case $stop
    _IENavigate($oIE, "about:blank")
    GUICtrlSetState($play, $GUI_ENABLE)
    GUICtrlSetState($stop, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_ENABLE)

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]
    Zitat

    was jetzt auch noch ist bei der neuen Version von AutoIt funktioniert dieser nicht mehr..

    klappt bei mir wunderbar. Aufbau der INI

    Code
    [Sender]
    1=http://www.youtube.com/watch?v=X9aZLXBxOK8
    2=http://www.youtube.com/watch?v=oc55U1S49Ws
    3=http://www.youtube.com/watch?v=aYdrEx82q5s
    4=http://www.youtube.com/watch?v=t0kZsAUn51M
    5=http://www.youtube.com/view_play_list?p=92F07153E7D85095&playnext=1&playnext_from=PL&v=gIMe4T2QIvA

    mfg (Auto)Bert

  • funtz net bekomme diese fehler meldung:

    For $i = 1 To $Sections[0][0]
    For $i = 1 To $Sections^ ERROR
    ->13:52:00 AutoIT3.exe ended.rc:1
    >Exit code: 1 Time: 1.802

    Edit:

    ich habe die INI oder URLS Datei so gestaltet.

    Zitat

    [Playlist - Streams]
    Stromae - Alors On Dance=http://www.youtube.com/watch?v=FkkXK3KsYx0
    Henny-M- Stay With Me (Groove-T Remix)=http://www.youtube.com/watch?v=VHdQwhfQQkY
    David Guetta - Sexy Bitch=http://www.youtube.com/watch?v=l0VORrZkiWc
    DJ Sanny Bassbrook mix=http://www.youtube.com/watch?v=ZXcI9NivkGM&feature=related

  • Hallo Zero2q,

    du musst diese Zeile:

    [autoit]

    $Sections = IniReadSection("Stream.urls", "Sender")

    [/autoit]


    auf dein neues Ini-Format anpassen also jetzt so:

    [autoit]

    $Sections = IniReadSection("Stream.urls", "Playlist - Streams")

    [/autoit]

    dann funktioniert dein Ursprungsskript.

    Edit: diese Zeile auch noch anpassen (schon neu)

    [autoit]

    $sSender = IniRead("Stream.urls", "Playlist - Streams", GUICtrlRead($RadioBox), "")

    [/autoit]

    Ergänzung: wenn du deine Ini so aufbaust, klappte es auch mit der automatischen Wiedergabe:

    Code
    [Playlist - Streams]
    HYMN  -  BARCLAY JAMES HARVEST=http://www.youtube.com/watch?v=X9aZLXBxOK8
    Child of Universe - Barclay James Harvest=http://www.youtube.com/watch?v=oc55U1S49Ws
    Poor man's moody blues - Barclay James Harvest=http://www.youtube.com/watch?v=aYdrEx82q5s
    [Playlist - Time]
    HYMN  -  BARCLAY JAMES HARVEST=285
    Child of Universe - Barclay James Harvest=390
    Poor man's moody blues - Barclay James Harvest=412

    dazu das Skript:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #Include <GuiComboBox.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Global $sSender

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Video Stream Player by Michi2q", 306, 421, 193, 139)
    $RadioBox = GUICtrlCreateCombo("", 15, 130, 270, 15, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
    GUISetBkColor(0xABABAB)
    $Group1 = GUICtrlCreateGroup("Player", 8, 8, 289, 89)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    $play = GUICtrlCreateButton("Abspielen", 16, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $stop = GUICtrlCreateButton("Stopp", 96, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $lauter = GUICtrlCreateButton("Lauter", 16, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $low = GUICtrlCreateButton("Leiser", 96, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Mute = GUICtrlCreateButton("Ton aus", 176, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Button6 = GUICtrlCreateButton("Links eintragen", 176, 32, 83, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Playliste", 8, 104, 289, 305)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;GUICtrlSetState(-1, $GUI_DISABLE)
    ; INET BEFEHLE
    $oIE = _IECreateEmbedded()
    GUICtrlCreateObj($oIE, -30, -30, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Inet Load
    If Not FileExists("Stream.urls") Then
    MsgBox(16, "Radio-Streamer", "Die URL Liste Existiert Nicht!")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    Else
    $Liste = ""
    $Sections = IniReadSection("Stream.urls", "Playlist - Streams")
    For $i = 1 To $Sections[0][0]
    $Liste &= $Sections[$i][0] & "|"
    Next
    $Liste &= "---" ;Ende der Liste
    GUICtrlSetData($RadioBox, $Liste)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    EndIf

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Mute
    Send("{VOLUME_MUTE}")
    Case $low
    Send("{VOLUME_DOWN}")
    Case $lauter
    Send("{VOLUME_UP}")

    [/autoit] [autoit][/autoit] [autoit]

    ; Musik Abspielen

    [/autoit] [autoit][/autoit] [autoit]

    Case $play
    If Not GUICtrlRead($RadioBox) = "" Then
    $iLast = _GUICtrlComboBox_GetCount($RadioBox)
    While $iLast > _GUICtrlComboBox_GetCurSel($RadioBox)+1
    $sSender = IniRead("Stream.urls", "Playlist - Streams", GUICtrlRead($RadioBox), "")
    $iTime = IniRead("Stream.urls", "Playlist - Time", GUICtrlRead($RadioBox), "")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($stop, $GUI_ENABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    ;#cs
    _IENavigate($oIE, $sSender,1)
    $iStart = TimerInit()
    Do
    Sleep(1000)
    $iDiff = TimerDiff($iStart)
    Until $iDiff > $iTime
    ;#ce
    ;Sleep(500)
    ;ConsoleWrite($sSender & @CRLF)
    _GUICtrlComboBox_SetCurSel($RadioBox, _GUICtrlComboBox_GetCurSel($RadioBox)+1)
    WEnd
    EndIf
    Case $stop
    _IENavigate($oIE, "about:blank")
    GUICtrlSetState($play, $GUI_ENABLE)
    GUICtrlSetState($stop, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_ENABLE)

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    mfg (Auto)Bert

    mfg (Auto)Bert

    3 Mal editiert, zuletzt von AutoBert (15. Mai 2010 um 15:39)

  • Wir kann ich zu der Conifg einen Editor machen oder ein Programm mit dem man seine eigenen Playlist zusammen stellen kann und diese variable laden kann? oO

    Edit:
    hatte mir das so irrgentwie vorgestellt

    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GUIListBox.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    $Form1_1_1 = GUICreate("Form1", 642, 365, 555, 226)
    $Input1 = GUICtrlCreateInput("Input1", 8, 24, 297, 21)
    $Label1 = GUICtrlCreateLabel("Track Hinzufügen", 8, 7, 89, 17)
    $Input2 = GUICtrlCreateInput("Input2", 8, 48, 297, 21)
    $Input3 = GUICtrlCreateInput("Input3", 8, 72, 297, 21)
    $Input4 = GUICtrlCreateInput("Input4", 8, 96, 297, 21)
    $Input5 = GUICtrlCreateInput("Input5", 8, 120, 297, 21)
    $Input6 = GUICtrlCreateInput("Input6", 8, 144, 297, 21)
    $Input7 = GUICtrlCreateInput("Input7", 8, 168, 297, 21)
    $Input8 = GUICtrlCreateInput("Input8", 8, 192, 297, 21)
    $List1 = GUICtrlCreateList("", 312, 16, 321, 201)
    $Group1 = GUICtrlCreateGroup("Speichern", 8, 216, 297, 137)
    $Input9 = GUICtrlCreateInput("Input9", 16, 248, 273, 21)
    $Label2 = GUICtrlCreateLabel("Datei-Name", 16, 231, 60, 17)
    $Input10 = GUICtrlCreateInput("Input10", 16, 288, 273, 21)
    $Label3 = GUICtrlCreateLabel("Speicherort", 16, 271, 58, 17)
    $Button1 = GUICtrlCreateButton("Durchsuchen", 16, 312, 75, 25)
    $Button2 = GUICtrlCreateButton("Datei Speichern", 104, 312, 107, 25)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button3 = GUICtrlCreateButton("Datei Suchen", 312, 224, 321, 25)
    $Button4 = GUICtrlCreateButton("Track hoch", 312, 256, 75, 25)
    $Button5 = GUICtrlCreateButton("Track runter", 392, 256, 75, 25)
    $Button6 = GUICtrlCreateButton("Speichern", 472, 256, 75, 25)
    $Button7 = GUICtrlCreateButton("Track Löschen", 552, 256, 83, 25)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]

    Edit2:
    Die Playlist Funktioniert nicht wirklich...
    Er überspringt immer das letzte lied besser gesagt er spielt nur eins der liste ab... -.-"

    Einmal editiert, zuletzt von Zero2q (15. Mai 2010 um 22:23)

  • Hallo Zero2q,

    Zitat von Zero2q

    Die Playlist Funktioniert nicht wirklich...
    Er überspringt immer das letzte lied besser gesagt er spielt nur eins der liste ab... -.-"

    Ich kann das Skript nur wegen meiner INet-Verbindung (ca. 14 KB/s) nur so testen:

    Spoiler anzeigen
    [autoit]

    Case $play
    If Not GUICtrlRead($RadioBox) = "" Then
    $iLast = _GUICtrlComboBox_GetCount($RadioBox)
    While $iLast > _GUICtrlComboBox_GetCurSel($RadioBox)+1
    $sSender = IniRead("Stream.urls", "Playlist - Streams", GUICtrlRead($RadioBox), "")
    $iTime = IniRead("Stream.urls", "Playlist - Time", GUICtrlRead($RadioBox), "")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($stop, $GUI_ENABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    #cs
    _IENavigate($oIE, $sSender,1)
    $iStart = TimerInit()
    Do
    Sleep(1000)
    $iDiff = TimerDiff($iStart)
    Until $iDiff > $iTime
    #ce
    Sleep(500)
    ConsoleWrite($sSender & @CRLF)
    _GUICtrlComboBox_SetCurSel($RadioBox, _GUICtrlComboBox_GetCurSel($RadioBox)+1)
    WEnd
    EndIf

    [/autoit]

    es wird aber jeder Titel der Playliste in die Scite-Konsole geschrieben. Hast du das komplette Skript von meinem vorgehendem Post genommen, oder nur obigen Teil ausgetauscht. Um auch das letzte Lied zu hören musste ich etwas tricksen:

    Spoiler anzeigen
    [autoit]

    ; Inet Load
    If Not FileExists("Stream.urls") Then
    MsgBox(16, "Radio-Streamer", "Die URL Liste Existiert Nicht!")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    Else
    $Liste = ""
    $Sections = IniReadSection("Stream.urls", "Playlist - Streams")
    For $i = 1 To $Sections[0][0]
    $Liste &= $Sections[$i][0] & "|"
    Next
    $Liste &= "---" ;Ende der Liste kann auch ein leerstelle sein
    GUICtrlSetData($RadioBox, $Liste)
    EndIf

    [/autoit]

    deine Lösung für die Playlist Zusammenstellung kommt mir etwas zu umständlich vor. Ich würde eine ListView nehmen mit 3 Spalten 1. Spalte Titel und Interpret 2. Spalte Link 3. Spalte Dauer und auf ButtonKlick entweder in einer 2. Gui die Titel erfassen oder mit Hilfe von ListView - Editieren aller SubItems direkt in der Listview editieren lassen. Listviews lassen sich auch sehr einfach als Datei speichern:

    Spoiler anzeigen
    [autoit]

    Func _saveLVs()
    Local $hFileOut, $sFile, $aItem
    $hFileOut = FileOpen(@ScriptDir & "\" & $sFile, 2)
    For $j = 0 To _GUICtrlListView_GetItemCount($hListView) - 1
    $aItem = _GUICtrlListView_GetItemTextString($hListView, $j)
    FileWriteLine($hFileOut, $aItem)
    Next
    FileClose($hFileOut)
    EndFunc ;==>_saveLVs

    [/autoit]

    und wieder laden:

    Spoiler anzeigen
    [autoit]

    Func _LoadLVs()
    Local $sFile, $aItems
    If FileExists($sFile) Then
    $aItems = ""
    _FileReadToArray($sFile, $aItems)
    If IsArray($aItems) Then
    ;;;_ArrayDisplay($aItems)
    For $j = 1 To $aItems[0]
    GUICtrlCreateListViewItem($aItems[$j], $hListView)
    Next
    EndIf
    EndIf
    EndFunc ;==>_LoadLVs

    [/autoit]

    so mache ich es in meinem YouTube Batch-Downloader (siehe Signatur), wenn ich wüsste wie ich an die Titel-Zeit komme, könnte ich alle benötigten Angaben über Clipget in die Listview aufnehmen,

    mfg (Auto)Bert

  • Player:

    [autoit]


    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #Include <GuiComboBox.au3>

    [/autoit][autoit][/autoit][autoit]

    Global $sSender

    [/autoit][autoit][/autoit][autoit]

    $Form1 = GUICreate("Video Stream Player by Michi2q", 306, 421, 193, 139)
    $RadioBox = GUICtrlCreateCombo("", 15, 130, 270, 15, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
    GUISetBkColor(0xABABAB)
    $Group1 = GUICtrlCreateGroup("Player", 8, 8, 289, 89)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    $play = GUICtrlCreateButton("Abspielen", 16, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $stop = GUICtrlCreateButton("Stopp", 96, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $lauter = GUICtrlCreateButton("Lauter", 16, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $low = GUICtrlCreateButton("Leiser", 96, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Mute = GUICtrlCreateButton("Ton aus", 176, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Button6 = GUICtrlCreateButton("Links eintragen", 176, 32, 83, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Playliste", 8, 104, 289, 305)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    ;GUICtrlSetState(-1, $GUI_DISABLE)
    ; INET BEFEHLE
    $oIE = _IECreateEmbedded()
    GUICtrlCreateObj($oIE, -30, -30, 0, 0)

    [/autoit][autoit][/autoit][autoit]

    ; Inet Load
    If Not FileExists("Stream.urls") Then
    MsgBox(16, "Radio-Streamer", "Die URL Liste Existiert Nicht!")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    Else
    $Liste = ""
    $Sections = IniReadSection("Stream.urls", "Playlist - Streams")
    For $i = 1 To $Sections[0][0]
    $Liste &= $Sections[$i][0] & "|"
    Next
    $Liste &= "---" ;Ende der Liste kann auch ein leerstelle sein
    GUICtrlSetData($RadioBox, $Liste)
    EndIf

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Mute
    Send("{VOLUME_MUTE}")
    Case $low
    Send("{VOLUME_DOWN}")
    Case $lauter
    Send("{VOLUME_UP}")

    [/autoit][autoit][/autoit][autoit]

    ; Musik Abspielen

    [/autoit][autoit][/autoit][autoit]

    Case $play
    If Not GUICtrlRead($RadioBox) = "" Then
    $iLast = _GUICtrlComboBox_GetCount($RadioBox)
    While $iLast > _GUICtrlComboBox_GetCurSel($RadioBox)+1
    $sSender = IniRead("Stream.urls", "Playlist - Streams", GUICtrlRead($RadioBox), "")
    $iTime = IniRead("Stream.urls", "Playlist - Time", GUICtrlRead($RadioBox), "")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($stop, $GUI_ENABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    #cs
    _IENavigate($oIE, $sSender,1)
    $iStart = TimerInit()
    Do
    Sleep(1000)
    $iDiff = TimerDiff($iStart)
    Until $iDiff > $iTime
    #ce
    Sleep(500)
    ConsoleWrite($sSender & @CRLF)
    _GUICtrlComboBox_SetCurSel($RadioBox, _GUICtrlComboBox_GetCurSel($RadioBox)+1)
    WEnd
    EndIf
    Case $stop
    _IENavigate($oIE, "about:blank")
    GUICtrlSetState($play, $GUI_ENABLE)
    GUICtrlSetState($stop, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_ENABLE)

    [/autoit][autoit][/autoit][autoit]

    EndSwitch
    WEnd

    [/autoit]

    Playlist:

    [autoit]


    [Playlist - Streams]
    Dj Styles - Send Me An Angel=http://www.youtube.com/watch?v=cH3Ou-W9hCE&feature=related
    Dj Sequence - Wanted Sound=http://www.youtube.com/watch?v=3W7kYVshqRY&feature=related

    [/autoit][autoit][/autoit][autoit]

    [Playlist - Time]
    Dj Styles- Send Me An Angel=430
    Dj Sequence- Wanted Sound=251

    [/autoit]

    Funktioniert einfach nicht habe es jetzt so umgebaut wie du es gesagt hast geht aber nicht...
    Er läd kein Lied

  • Hallo Zero2q,

    du hast jetzt die Testversion gestartet, d.h. nur Ausgabe des Titels auf der Konsole. Du musst das auskommentierte zulassen, also so:
    Edit4: neuer Ansatz

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <GuiStatusBar.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <IE.au3>
    #Include <GuiComboBox.au3>
    #Include <Date.au3>
    #include <array.au3> ;wenn Ini geklärt kann dies gelöscht werden

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Global $sSender

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Video Stream Player by Michi2q", 306, 421, 193, 139)
    $RadioBox = GUICtrlCreateCombo("", 15, 130, 270, 15, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL))
    GUISetBkColor(0xABABAB)
    $Dauer = GUICtrlCreateLabel("0",15,190,270,20) ;wieder löschen
    $Group1 = GUICtrlCreateGroup("Player", 8, 8, 289, 89)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    $play = GUICtrlCreateButton("Abspielen", 16, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $stop = GUICtrlCreateButton("Stopp", 96, 32, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $lauter = GUICtrlCreateButton("Lauter", 16, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $low = GUICtrlCreateButton("Leiser", 96, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Mute = GUICtrlCreateButton("Ton aus", 176, 64, 75, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    $Button6 = GUICtrlCreateButton("Links eintragen", 176, 32, 83, 25)
    GUICtrlSetFont(-1, 8, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0x800000)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("Playliste", 8, 104, 289, 305)
    GUICtrlSetFont(-1, 10, 800, 2, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xC0DCC0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;GUICtrlSetState(-1, $GUI_DISABLE)
    ; INET BEFEHLE
    $oIE = _IECreateEmbedded()
    GUICtrlCreateObj($oIE, -30, -30, 0, 0)

    [/autoit] [autoit][/autoit] [autoit]

    ; Inet Load
    If Not FileExists("Stream.urls") Then
    MsgBox(16, "Radio-Streamer", "Die URL Liste Existiert Nicht!")
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    Else
    $Liste = ""
    $Sections = IniReadSection("Stream.urls", "Playlist - Streams")
    $aTimes = IniReadSection("Stream.urls", "Playlist - Time") ;nur zur Kontrolle wieder löschen hier werden die Zeiten eingelesen
    _ArrayDisplay($aTimes) ;wenn Ini geklärt kann dies gelöscht werden
    For $i = 1 To $Sections[0][0]
    $Liste &= $Sections[$i][0] & "|"
    Next
    $Liste &= "---" ;Ende der Liste kann auch ein leerstelle sein
    GUICtrlSetData($RadioBox, $Liste)
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Mute
    Send("{VOLUME_MUTE}")
    Case $low
    Send("{VOLUME_DOWN}")
    Case $lauter
    Send("{VOLUME_UP}")

    [/autoit] [autoit][/autoit] [autoit]

    ; Musik Abspielen

    [/autoit] [autoit][/autoit] [autoit]

    Case $play
    If Not GUICtrlRead($RadioBox) = "" Then
    $iLast = _GUICtrlComboBox_GetCount($RadioBox)
    While $iLast > _GUICtrlComboBox_GetCurSel($RadioBox)+1
    $sTitel = GUICtrlRead($RadioBox)
    $sSender = IniRead("Stream.urls", "Playlist - Streams", $sTitel, "")
    $iTime = IniRead("Stream.urls", "Playlist - Time", $sTitel, 20) ;hier läuft es schief da der Default Wert genommen wird
    GUICtrlSetState($play, $GUI_DISABLE)
    GUICtrlSetState($stop, $GUI_ENABLE)
    GUICtrlSetState($RadioBox, $GUI_DISABLE)
    _IENavigate($oIE, $sSender,1) ;hier ist der eigentliche Aufruf darf nur zu Testzwecken auskommentiert werden
    $iEnd = _DateAdd('s',$iTime,_NowCalc())
    ConsoleWrite($iTime & @TAB & $iEnd & @CRLF)
    ConsoleWrite($sTitel & @TAB & "Start: " & _NowCalc() & @CRLF)
    Do
    Sleep(1000)
    Until _NowCalc() > $iEnd
    ConsoleWrite(@TAB & "Ende: " & _NowCalc() & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ;bis hier ich musste das zum Testen auskommentieren, da es keinen Spass macht immer nur ein paar Musikfetzen zu hören und dann wieder zu warten bis es nachgeladen hat
    ;#ce
    Sleep(500)
    _GUICtrlComboBox_SetCurSel($RadioBox, _GUICtrlComboBox_GetCurSel($RadioBox)+1)
    WEnd
    EndIf
    Case $stop
    _IENavigate($oIE, "about:blank")
    GUICtrlSetState($play, $GUI_ENABLE)
    GUICtrlSetState($stop, $GUI_DISABLE)
    GUICtrlSetState($RadioBox, $GUI_ENABLE)

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    dieses Schema scheitert derzeit noch am Auslesen der Zeit aus der INI, finde jetzt aber den Fehler nicht :sleeping: Vielleicht findet ihn ja jemand anders, ansonsten schaue ich heute Mittag noch einmal
    Edit5: der Fehler tritt nur bei der von dir eingestellten INI auf, mit der ich dummerweise getestet habe. Mit einer von mir erzeugten INI klappt es

    mfg (Auto)Bert

  • ich kenne keine Möglichkeit, wie man feststellen kann, ob ein Lied zu Ende gespielt ist. Wenn du eine findest würde es so funktionieren:

    Müsste doch eig. so gehen:

    [autoit]


    #include <Sound.au3>
    While 1

    [/autoit][autoit][/autoit][autoit]

    if _Soundlength($song, 2) = _SoundPos($song, 2) Then
    ;....
    EndIf
    WEnd

    [/autoit]
  • Nee sry aber das entspricht gar nicht mehr meiner vorstellung
    unteranderem funktioniert der Stoppp button nicht mehr ich glaube ich muss mich doch selber durch kämpfen
    weil das ganze so weit abtrieftet aber trozdem danke...

  • Hallo stayawayknight,

    Müsste doch eig. so gehen:

    [autoit]


    #include <Sound.au3>
    While 1

    [/autoit] [autoit][/autoit] [autoit]

    if _Soundlength($song, 2) = _SoundPos($song, 2) Then
    ;....
    EndIf
    WEnd

    [/autoit]

    in diesem Thread geht es um das Abspielen von Online (YouTube) Inhalten ohne diese downzuloaden. Du solltest vielleicht die Threads vorher lesen, bevor du einzelne Aussagen (aus dem Zusammenhang gerissen) in Zweifel ziehst,

    PS.: so ist deine Lösung (wo einsetzbar) sicherer

    [autoit]

    if _Soundlength($song, 2) >= _SoundPos($song, 2) Then

    [/autoit]

    jetzt 100% vorher nur 99,999% ;)

    mfg (Auto)Bert

  • autoBert: Doch ich hab den Thread gelesen aber ich öffne immer mehrere Threads gleichzeitig in mehreren Tabs vom Browser, da hab ich das irgendwie
    mit dem MP3Player Thread da verwechselt... Sorry

    Kann mir zwar nicht vorstellen, dass eine Soundpostition weiter ist als die Soundlänge erlaubt, aber sicher ist sicher ;) Tut aber jetzt hier nichts mehr zur Sache