Javascript problem in 2.6

Jan 10, 2012 at 3:07 PM
Edited Jan 10, 2012 at 3:18 PM

Hi,

I had a custom SMF (2.5 version) player with the javascript API provided in the SMF and worked fine. When I have updated to 2.6 version, not works. If I use the SmoothStreamingPlayer.xap (provided with the SMF 2.6) it works fine.

I have is the code below. Can anyone help?

 

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Core="clr-namespace:Microsoft.SilverlightMediaFramework.Core;assembly=Microsoft.SilverlightMediaFramework.Core"
    xmlns:Media="clr-namespace:Microsoft.SilverlightMediaFramework.Core.Media;assembly=Microsoft.SilverlightMediaFramework.Core"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:smf_converters="http://schemas.microsoft.com/smf/2010/xaml/converters" xmlns:smf_accesscontrols="http://schemas.microsoft.com/smf/2010/xaml/accesscontrols" 
    x:Class="SMF_SmoothStreamingMine.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot" Background="White">
        <Core:SMFPlayer ScriptableName="Player" />
    </Grid>
</UserControl>

 
<script type="text/javascript">
        var slCtl = null;
        function pluginLoaded(sender, args) {
            slCtl = sender.getHost().Content;
            slCtl.Player.PlayStateChanged = evtPlayStateChanged;
            slCtl.Player.SeekCompleted = evtSeekCompleted;
        }

        function evtPlayStateChanged(player, args) {
            if (player.PlayState == 3) {
                alert("Playing: " + player.PlaybackPositionSeconds);
            }
            else if (player.PlayState == 4) {
                alert("Paused: " + player.PlaybackPositionSeconds);
            }
        }

        function evtSeekCompleted(player, args) {
            alert("Seek: " + player.PlaybackPositionSeconds);
        }

        function createNewPlaylistItem() {
            var NewPlaylistItem = slCtl.Player.CreatePlaylistItem('http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/elephantsdream/Elephants_Dream_1024-h264-st-aac.ism/manifest', '', 'Title', 'Description');
            NewPlaylistItem.DeliveryMethod = 'AdaptiveStreaming';
            var NewPlaylist = slCtl.Player.CreatePlaylist();
            NewPlaylist.AddPlaylistItem(NewPlaylistItem);
            slCtl.Player.SetPlaylist(NewPlaylist);
        }
    </script>

<
object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="95%"> <param name="source" value="../../ClientBin/SMF_SmoothStreamingMine.xap"/> <param name="onload" value="pluginLoaded" /> <param name="background" value="white" /> <param name="minRuntimeVersion" value="4.0.50303.0" /> <param name="autoUpgrade" value="true" /> <param name="InitParams" value="scriptablename=Player" /> <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50303.0" style="text-decoration:none"> <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/> </a> </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>

Jan 11, 2012 at 7:30 AM

Do you experience somewhat the same issues as i do in http://smf.codeplex.com/discussions/284795 ?

Jan 11, 2012 at 8:05 AM
lokexstream wrote:

Do you experience somewhat the same issues as i do in http://smf.codeplex.com/discussions/284795 ?

Yes, it seems the tame issues

Jan 16, 2012 at 3:27 PM

Hello,

Adding LogLevel="All" LoggingConsoleVisibility="Visible" in my MainPage.xaml, I've noticed a .dll was not loading correctly. I fixed it, and now,the player works ok.

May 22, 2012 at 2:25 PM
Edited May 22, 2012 at 2:25 PM

Hello,

Can you please give me the name of .dll causing the issue.

Also can I assign the isml from the aspx page?

I mean :

Aspx is containing the SMFplayer and the aspx textbox and button. I want to enter the publish point  url into the textbox and then hit button to play in above 

SMFplayer player.

 

Hope I written requirement clearly. If not, please let me ask.

Thanks

Kapil