Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Visual-Studio WebForms VB.NET , +
When I pause streaming video VLC component on VB.Net. Come back few minutes later. Click play again it restarts from beginning. Then I have to click point on slider where was last at, so to resume
 

Sometimes this will even occur when playing streamed video without being paused, all of a sudden will stop or restart from beginning. And I will have to then click position on slider manually and wait to buffer again
 

Does anyone know of a fix for this?
 

Code below:
 
Imports System.Text.RegularExpressions
    
    Public Class Form1
        Dim Paused As Boolean = False
        Dim Started As Boolean = False
        Dim PlayedSecond As Boolean = True
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            PlayedSecond = False
            AxVLCPlugin21.playlist.items.clear()
            AxVLCPlugin21.playlist.add("http://binder-science.wikispaces.com/file/view/The+Characteristics+of+Living+Things.flv")
            AxVLCPlugin21.playlist.play()
            Started = True
        End Sub
    
        Sub playsecond()
            AxVLCPlugin21.playlist.items.clear()
            AxVLCPlugin21.playlist.add("http://postfcs.wikispaces.com/file/view/Nature+by+Numbers+%5Bwww.keepvid.com%5D.flv")
            AxVLCPlugin21.playlist.play()
            PlayedSecond = True
            Started = False
        End Sub
    
        Private Sub AxVLCPlugin21_pause(sender As Object, e As EventArgs) Handles AxVLCPlugin21.pause
            Paused = True
        End Sub
    
        Private Sub IsFinished_Tick(sender As Object, e As EventArgs) Handles IsFinished.Tick
            If Not AxVLCPlugin21.playlist.isPlaying And Paused = False And Started = True And PlayedSecond = False Then
                playsecond()
                Started = True
            End If
        End Sub
    
        Private Sub AxVLCPlugin21_play(sender As Object, e As EventArgs) Handles AxVLCPlugin21.play
            Paused = False
        End Sub
    
        Private Enum InputState
            IDLE = 0
            OPENING = 1
            BUFFERING = 2
            PLAYING = 3
            PAUSED = 4
            STOPPING = 5
            ENDED = 6
            ERRORSTATE = 7
        End Enum
    
    
        Private Sub InfoTimer_Tick(sender As Object, e As EventArgs) Handles InfoTimer.Tick
            Dim state As InputState = DirectCast(AxVLCPlugin21.input.state, InputState)
            Select Case state
                Case InputState.IDLE, InputState.OPENING, InputState.BUFFERING
                    Status.Text = state.ToString()
                    Exit Select
                Case InputState.PLAYING
                    Dim title As String = System.IO.Path.GetFileName(AxVLCPlugin21.mediaDescription.title)
                    Dim current As TimeSpan = TimeSpan.FromMilliseconds(AxVLCPlugin21.input.Time)
                    Dim total As TimeSpan = TimeSpan.FromMilliseconds(AxVLCPlugin21.input.Length)
                    Dim pos As Double = AxVLCPlugin21.input.Position
                    Status.Text = String.Format("{0} {1} {2}:{3:D2}/{4}:{5:D2} {6:P}", state, title, current.Minutes, current.Seconds, total.Minutes, total.Seconds, pos)
                    Exit Select
                Case InputState.PAUSED
                    Status.Text = String.Format("{0} {1}", state, System.IO.Path.GetFileName(AxVLCPlugin21.mediaDescription.title))
                    Exit Select
                Case InputState.STOPPING, InputState.ENDED
                    playsecond()
                    Exit Select
                Case InputState.ERRORSTATE
                    Status.Text = String.Format("{0} {1}", state, AxVLCPlugin21.mediaDescription.title)
                    Exit Select
                Case Else
                    Status.Text = state.ToString()
                    Exit Select
            End Select
        End Sub
    
    End Class
Posted 2-May-13 8:10am
Edited 2-May-13 8:12am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

That is an internal problem with the VLC component you're using, not with your VB.NET code.
 
Contact the manufacturer of the component you're using for support on this.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 265
2 CPallini 235
3 Maciej Los 190
4 Sergey Alexandrovich Kryukov 189
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 2 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100