@iamtraction/play-dl
    Preparing search index...

    Function stream_from_info

    Creates a Stream [ YouTube or SoundCloud ] class from video or track info for playing.

    Example

    const info = await video_info('youtube URL')
    const source = await play.stream_from_info(info) // YouTube Video Stream

    const soundInfo = await play.soundcloud('SoundCloud URL')
    const source = await play.stream_from_info(soundInfo) // SoundCloud Track Stream

    const source = await play.stream_from_info(info, { seek : 45 }) // Seeks 45 seconds (approx.) in YouTube Video Stream

    const resource = createAudioResource(source.stream, {
    inputType : source.type
    }) // Use discordjs voice createAudioResource function.

    YouTube video info OR SoundCloud track Class

    number seek : No of seconds to seek in stream.

    • string language : Sets language of searched content [ YouTube search only. ], e.g. "en-US"
    • number quality : Quality number. [ 0 = Lowest, 1 = Medium, 2 = Highest ]
    • boolean htmldata : given data is html data or not
    • number precache : No of segments of data to store before looping [YouTube Live Stream only]. [ Defaults to 3 ]
    • boolean discordPlayerCompatibility : Conversion of Webm to Opus[ Defaults to false ]

    A YouTubeStream or SoundCloudStream Stream to play