
# importing time and vlc
import time
import vlc

# method to play video
def video(source):

    # creating a vlc instance
    vlc_instance = vlc.Instance()

    # creating a media player
    player = vlc_instance.media_player_new()

    # creating a media
    media = vlc_instance.media_new(source)

    # setting media to the player
    player.set_media(media)

    # play the video
    player.play()

    # wait time
    time.sleep(10)

    # getting the duration of the video
    duration = player.get_length()

    # printing the duration of the video
    print("Duration : " + str(duration))

# call the video method
video("../data/070_SHARP_Titles_Flower_Titles.mp4")


# importing time and vlc
import time
import vlc

# method to play video
def video(source):

    # creating a vlc instance
    vlc_instance = vlc.Instance()

    # creating a media player
    player = vlc_instance.media_player_new()

    # creating a media
    media = vlc_instance.media_new(source)

    # setting media to the player
    player.set_media(media)

    # play the video
    player.play()

    # wait time
    time.sleep(10)

    # getting the duration of the video
    duration = player.get_length()

    # printing the duration of the video
    print("Duration : " + str(duration))

# call the video method
video("../data/070_SHARP_Titles_Flower_Titles.mp4")

# importing time and vlc # method to play video # creating a vlc instance # creating a media player # creating a media # setting media to the player # play the video # wait time # getting the duration of the video # printing the duration of the video # call the video method