locked
Nearly give up, how to play RTSP / HLS / Smooth Streaming in Visual Basic Language

    Question

  • I know there are so many samples for playing RTSP / HLS / Smooth Streaming, but it really lacks supporting Visual Basic language, i really struggling to convert from C++ / C# into VB without errors, maybe it would be easier if i can find some VB examples for this situation, i really appreciated any help.. thanks
    Sunday, December 21, 2014 10:52 AM

Answers

  • Change the Platform as x64 works fine instead of AnyCPU.

    Base on the documentation: https://visualstudiogallery.msdn.microsoft.com/0170c67c-c183-4fee-8dd4-c2b44d710d40

    Looks like it should support 3 platforms. However I only got x64 works on my device, probably because my computer is x64 based.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 26, 2014 2:35 AM
    Moderator

All replies

  • Hi HiLLzX,

    What kind of error you are facing while convert code from C# to VB?

    Did you tried something like Microsoft Smooth Streaming Client for Windows 8

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 22, 2014 8:47 AM
    Moderator
  • Hello James,

    yes i already tried C# Smooth Streaming sample on https://code.msdn.microsoft.com/windowsapps/Smooth-Streaming-Client-0bb1471f

    , it works, then i tried to convert it to VB with exactly similar objects, added all references, VB version doesn't work.

    I have a curious feeling about this line of code :

            

    private MediaExtensionManager extensions = new MediaExtensionManager();     ..... bla bla

    ...... bla bla               extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler"".ism""text/xml");              extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler"".ism""application/vnd.ms-sstr+xml");

    i tried to convert it also into VB, it seems those extensions doesn't registered well on VB, or do you have another suggestion ? thanks

    Monday, December 22, 2014 11:36 AM
  • Hi HiLLzX,

    Did you forget to using reference in VB or Import the namespace? See my current code, using Button click can play a test demo. Do not forget to reference SDk in your project.

    XAML:

    <Page
        x:Class="App242.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:App242"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d">
    
        <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <Button Content="Button" HorizontalAlignment="Left" Height="88" Margin="52,103,0,0" VerticalAlignment="Top" Width="138" Click="Button_Click"/>
            <MediaElement x:Name="mediaElement" HorizontalAlignment="Left" Height="427" Margin="409,127,0,0" VerticalAlignment="Top" Width="800"/>
    
        </Grid>
    </Page>

    VB:

    'using Windows.Media;
    Imports Windows.Media
    
    
    ' The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
    
    ''' <summary>
    ''' An empty page that can be used on its own or navigated to within a Frame.
    ''' </summary>
    Public NotInheritable Class MainPage
        Inherits Page
    
        Private extensions As New MediaExtensionManager
    
    
    
        Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
    
            mediaElement.Source = New Uri("http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest")
    
            extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml")
            extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/vnd.ms-sstr+xml")
    
            
            mediaElement.Play()
    
        End Sub
    End Class
    
    

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, December 23, 2014 8:47 AM
    Moderator
  • Hi James, thank you for your kindness, i did all your sugestions, but strangely mediaelement always show blank video, would you check my project? i copied all of your code but changed the URL only.

    My Project Link:

    https://www.dropbox.com/s/lbvpo2veqz89iy7/Smooth%20Stream%20VB.zip?dl=0

    Wednesday, December 24, 2014 2:27 PM
  • Hi HiLLzX,

    I'm working on your project, will reply here once I have some update :)

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 26, 2014 2:22 AM
    Moderator
  • Change the Platform as x64 works fine instead of AnyCPU.

    Base on the documentation: https://visualstudiogallery.msdn.microsoft.com/0170c67c-c183-4fee-8dd4-c2b44d710d40

    Looks like it should support 3 platforms. However I only got x64 works on my device, probably because my computer is x64 based.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 26, 2014 2:35 AM
    Moderator
  • Another possibility could be because your programming language is VB.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 7, 2015 5:59 AM
    Moderator