public AdMarkerManager(SMFPlayer Player)
 {
     player            = Player;
     JumpToLiveAfterAd = true;
     PlayAdsOnSeek     = true;
     PlayAdsOnFwdRwd   = true;
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/Logging/DisplayLog" +
                 "gingConsole.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.player = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("player")));
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples.Advertising;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.banner = ((System.Windows.Controls.Grid)(this.FindName("banner")));
     this.smf = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("smf")));
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/Offline/LocalFileE" +
                 "xample.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.player = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("player")));
     this.btnOpenFile = ((System.Windows.Controls.Button)(this.FindName("btnOpenFile")));
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/Anaglyph3D/SimpleA" +
                 "naglyph3D.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.AnaglyphModeSelector = ((System.Windows.Controls.ComboBox)(this.FindName("AnaglyphModeSelector")));
     this.smfPlayer = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("smfPlayer")));
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/PlayerControl/Exte" +
                 "rnalControls.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.itemText = ((System.Windows.Controls.TextBox)(this.FindName("itemText")));
     this.goButton = ((System.Windows.Controls.Button)(this.FindName("goButton")));
     this.player = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("player")));
 }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/iTVOD_WindowPhone7;component/Live_Channel_PLayer_V2.xaml", System.UriKind.Relative));
     this.LayoutRoot   = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.strmPlayer   = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("strmPlayer")));
 }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/Captions/CodeCapti" +
                                                                   "ons.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.player     = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("player")));
 }
Example #9
0
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/SkyStream;component/Page1.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.TitlePanel = ((System.Windows.Controls.StackPanel)(this.FindName("TitlePanel")));
     this.ContentPanel = ((System.Windows.Controls.Grid)(this.FindName("ContentPanel")));
     this.SongName = ((System.Windows.Controls.TextBlock)(this.FindName("SongName")));
     this.SMFPlay = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("SMFPlay")));
 }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples.Advertising;component/MainPage.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.banner     = ((System.Windows.Controls.Grid)(this.FindName("banner")));
     this.smf        = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("smf")));
 }
Example #11
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/Anaglyph3D/SimpleA" +
                                                                   "naglyph3D.xaml", System.UriKind.Relative));
     this.LayoutRoot           = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.AnaglyphModeSelector = ((System.Windows.Controls.ComboBox)(this.FindName("AnaglyphModeSelector")));
     this.smfPlayer            = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("smfPlayer")));
 }
Example #12
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/Offline/LocalFileE" +
                                                                   "xample.xaml", System.UriKind.Relative));
     this.LayoutRoot  = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.player      = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("player")));
     this.btnOpenFile = ((System.Windows.Controls.Button)(this.FindName("btnOpenFile")));
 }
Example #13
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.SilverlightMediaFramework.Samples;component/Samples/PlayerControl/Exte" +
                                                                   "rnalControls.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.itemText   = ((System.Windows.Controls.TextBox)(this.FindName("itemText")));
     this.goButton   = ((System.Windows.Controls.Button)(this.FindName("goButton")));
     this.player     = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("player")));
 }
 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.HealthMonitorPlayer;component/Views/Player.xaml", System.UriKind.Relative));
     this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.SettingStates = ((System.Windows.VisualStateGroup)(this.FindName("SettingStates")));
     this.SettingsVisible = ((System.Windows.VisualState)(this.FindName("SettingsVisible")));
     this.SettingsHidden = ((System.Windows.VisualState)(this.FindName("SettingsHidden")));
     this.playerSmooth = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("playerSmooth")));
     this.SettingsPanel = ((System.Windows.Controls.Border)(this.FindName("SettingsPanel")));
     this.SettingsScaler = ((System.Windows.Media.ScaleTransform)(this.FindName("SettingsScaler")));
     this.TraceConfig = ((Microsoft.HealthMonitorPlayer.Views.TraceConfig)(this.FindName("TraceConfig")));
 }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Microsoft.HealthMonitorPlayer;component/Views/Player.xaml", System.UriKind.Relative));
     this.LayoutRoot      = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.SettingStates   = ((System.Windows.VisualStateGroup)(this.FindName("SettingStates")));
     this.SettingsVisible = ((System.Windows.VisualState)(this.FindName("SettingsVisible")));
     this.SettingsHidden  = ((System.Windows.VisualState)(this.FindName("SettingsHidden")));
     this.playerSmooth    = ((Microsoft.SilverlightMediaFramework.Core.SMFPlayer)(this.FindName("playerSmooth")));
     this.SettingsPanel   = ((System.Windows.Controls.Border)(this.FindName("SettingsPanel")));
     this.SettingsScaler  = ((System.Windows.Media.ScaleTransform)(this.FindName("SettingsScaler")));
     this.TraceConfig     = ((Microsoft.HealthMonitorPlayer.Views.TraceConfig)(this.FindName("TraceConfig")));
 }
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var player = new SMFPlayer();

            if (e.InitParams != null)
            {
                if (!e.InitParams.ContainsKeyIgnoreCase(SupportedInitParams.DeliveryMethod))
                {
                    e.InitParams.Add(SupportedInitParams.DeliveryMethod, DeliveryMethods.ProgressiveDownload.ToString());
                }

                player.LoadInitParams(e.InitParams);
                player.PlaylistVisibility = player.Playlist != null && player.Playlist.Count > 1
                                         ? FeatureVisibility.Hidden
                                         : FeatureVisibility.Disabled;

                player.CaptionsVisibility = e.InitParams.ContainsKeyIgnoreCase(SupportedInitParams.SelectedCaptionStream)
                                        ? FeatureVisibility.Visible
                                        : FeatureVisibility.Disabled;
            }

            this.RootVisual = player;
        }
 public static void SetPlayerCommand(SMFPlayer player, PlayerCommand value)
 {
     player.SetValue(PlayerCommandProperty, value);
 }
 public static PlayerCommand GetPlayerCommand(SMFPlayer player)
 {
     return (PlayerCommand) player.GetValue(PlayerCommandProperty);
 }
 internal double GetBitrate(SMFPlayer player)
 {
     return (player == null || player.PlaybackBitrate == 0) ? -1 : BytesUtil.ConvertBytesToMegabytes(player.PlaybackBitrate);
 }
 internal long GetDuration(SMFPlayer player)
 {
     return (player == null || player.IsMediaLive || player.EndPosition == null) ? 0 : Convert.ToInt64(player.EndPosition.TotalSeconds);
 }
Example #21
0
        /// <summary>
        /// Add a piece of content with an ad stream or url to the smf player's playlist; internal.
        /// </summary>
        /// <param name="player">The smf player to add the content to</param>
        /// <param name="contentUrl">The url to the content</param>
        /// <param name="method">The delivery method for the content (adaptive or progressive)</param>
        /// <param name="adSchedule">The stream to the ad schedule</param>
        /// <param name="startTime">The time in the content where playback will begin</param>
        /// <param name="assetID">The asset ID of the content that is being played</param>
        internal static void AddContentWithAdToPlaylistInternal(SMFPlayer player, string contentUrl, DeliveryMethods method, object adSchedule, TimeSpan startTime, string assetID)
        {
            PlaylistItem item = new PlaylistItem()
            {
                StartPosition = startTime,
                MediaAssetId = assetID,
                DeliveryMethod = method,
                MediaSource = new Uri(contentUrl),
                CustomMetadata = new Utilities.Metadata.MetadataCollection()
                {
                    new Utilities.Metadata.MetadataItem() { Key = Key_AdUrl, Value = adSchedule }
                }
            };

            player.Playlist.Add(item);
        }
            new PropertyMetadata(ContainerHostPropertyChanged));                          //Callback invoked in case the property value has changed

        /// <summary>
        /// Ads the element to the specified player's Containers collection. For programmatic use, add to the SMFPlayer.Containers collection is recommended.
        /// </summary>
        /// <param name="obj">The FrameworkElement we want to add to the player's Container collection.</param>
        /// <param name="player">The SMFPlayer whose Containers collection is to be added to.</param>
        public static void SetContainerHost(FrameworkElement obj, SMFPlayer player)
        {
            obj.SetValue(ContainerHostProperty, player);
        }
 public void SetPlayer(FrameworkElement player)
 {
     _player = player as SMFPlayer;
 }
 internal string GetFilename(SMFPlayer player)
 {
     return (player != null && player.CurrentPlaylistItem != null && player.CurrentPlaylistItem.MediaSource != null) ? Path.GetFileName(player.CurrentPlaylistItem.MediaSource.AbsolutePath) : string.Empty;
 }
        /// <summary>
        /// Initialize the playback and the plugin
        /// </summary>
        /// <param name="systemId">your NicePeopleAtWork account code that indicates Youbora Analytics which 
        /// customer account the data is sent to.This will be provided by NicePeopleAtWork, if you don’t have it yet, 
        /// please ask it to your Customer Engineering Manager or Support Agent.</param>
        /// <param name="userId">user ID value inside your system. Leave it blank if you don't want to use it. 
        /// This will help you to easily identify your users inside Youbora Analytics and filter all that user's views.</param>
        /// <param name="playerInstance">it is an instance of SMFPlayer initialized with a resource.</param>
        public void Tracking(string systemId,
            string userId,
            SMFPlayer playerInstance)
        {
            // Init
            Init(userId);

            _smfPlayer = playerInstance;

            YouboraAvPlayerLog("Init", "YouboraAvPlayer Init - User: " + userId, LogType.Generic);

            Data(systemId);

            // Register events
            if (_smfPlayer != null)
            {
                _smfPlayer.Loaded += _smfPlayer_Loaded;
                _smfPlayer.MediaOpened += _smfPlayer_MediaOpened;
                _smfPlayer.MediaFailed += _smfPlayer_MediaFailed;
                _smfPlayer.PlayStateChanged += _smfPlayer_PlayStateChanged;
                _smfPlayer.ScrubbingStarted += _smfPlayer_ScrubbingStarted;
                _smfPlayer.ScrubbingCompleted += _smfPlayer_ScrubbingCompleted;
                _smfPlayer.PlaylistItemChanged += _smfPlayer_PlaylistItemChanged;
                _smfPlayer.PlaylistReachedEnd += _smfPlayer_PlaylistReachedEnd;
                _smfPlayer.PlaybackPositionChanged += _smfPlayer_PlaybackPositionChanged;
                _smfPlayer.PlaylistChanged += _smfPlayer_PlaylistChanged;
                _smfPlayer.Unloaded += _smfPlayer_Unloaded;
                _smfPlayer.VolumeLevelChanged += _smfPlayer_VolumeLevelChanged;
                _smfPlayer.PlaybackBitrateChanged += _smfPlayer_PlaybackBitrateChanged;
                _smfPlayer.IsMutedChanged += _smfPlayer_IsMutedChanged;
                _smfPlayer.BufferingProgressChanged += _smfPlayer_BufferingProgressChanged;
                _smfPlayer.DownloadProgressChanged += _smfPlayer_DownloadProgressChanged;
                _smfPlayer.RetryStateChanged += _smfPlayer_RetryStateChanged;
                _smfPlayer.MediaCommand += _smfPlayer_MediaCommand;

                if (_smfPlayer.Playlist != null)
                    _smfPlayer.Playlist.CollectionChanged += Playlist_CollectionChanged;
            }
        }
        /// <summary>
        /// Provides a mechanism to pass the SMF player to the plugin.
        /// </summary>
        /// <param name="player"></param>
        public void SetPlayer(FrameworkElement player)
        {
            smfPlayer = player as SMFPlayer;
            smfPlayer.PlaylistItemChanged += smfPlayer_PlaylistItemChanged;
#if !OOB
            smfPlayer.FullScreenChanged += smfPlayer_FullScreenChanged;
#endif
            smfPlayer.SizeChanged += smfPlayer_SizeChanged;
            smfPlayer.PlaybackBitrateChanged += smfPlayer_PlaybackBitrateChanged;
            smfPlayer.PlayStateChanged += smfPlayer_PlayStateChanged;
            smfPlayer.MediaPluginRegistered += smfPlayer_MediaPluginRegistered;

            InitializeAnaglyphSetup();
        }
        public void Unload()
        {
            try
            {
                smf.MediaOpened -= smf_MediaOpened;
                smf.PlaylistItemChanged -= smf_PlaylistItemChanged;
                smf.PlayRateChanged -= smf_PlayRateChanged;
                smf.BufferingProgressChanged -= smf_BufferingProgressChanged;
                smf.MediaTransport.ThumbnailRequest -= MediaTransport_ThumbnailRequest;
                smf = null;

                thumbManager.LoadThumbnailAsync -= thumbManager_LoadThumbnailAsync;
                thumbManager.ShowThumbnail -= thumbManager_ShowImage;
                thumbManager = null;

                IsLoaded = false;
                PluginUnloaded.IfNotNull(p => p(this));
            }
            catch (Exception ex)
            {
                PluginUnloadFailed.IfNotNull(p => p(this, ex));
            }
        }
        /// <summary>
        /// Detaches the SMFPlayer so it no longer monitored.
        /// </summary>
        /// <param name="smfPlayer"></param>
        public void DetachFromSMF(SMFPlayer smfPlayer)
        {
            smfPlayer.CaptionsVisibilityChanged -= smfPlayer_CaptionsVisibilityChanged;
            smfPlayer.AudioStreamChanged -= smfPlayer_AudioStreamChanged;
            smfPlayer.RetryFailed -= smfPlayer_RetryFailed;
            smfPlayer.RetrySuccessful -= smfPlayer_RetrySuccessful;
            smfPlayer.PlayStateChanged -= smfPlayer_PlayStateChanged;
            smfPlayer.PlaylistItemChanged -= smfPlayer_PlaylistItemChanged;

            DetachFromMediaElement();
        }
        /// <summary>
        /// Initialize the playback and the plugin
        /// </summary>
        /// <param name="systemId">your NicePeopleAtWork account code that indicates Youbora Analytics which 
        /// customer account the data is sent to.This will be provided by NicePeopleAtWork, if you don’t have it yet, 
        /// please ask it to your Customer Engineering Manager or Support Agent.</param>
        /// <param name="userId">user ID value inside your system. Leave it blank if you don't want to use it. 
        /// This will help you to easily identify your users inside Youbora Analytics and filter all that user's views.</param>
        /// <param name="playerInstance">it is an instance of SMFPlayer initialized with a resource.</param>
        /// <param name="smartswitch">Enable the use of smartswitch</param>
        /// <param name="analyticsActive">It enables or disables all the Analytics module features</param>
        /// <param name="liveFlag">lets analytics identify if the user is playing a Live or VoD content.</param>
        /// 
        /// NOTE: It is very important that the instance of MediaElement are correctly initialized when you call this method.
        public void Tracking(string systemId,
           string userId,
           SMFPlayer playerInstance,
           bool smartswitch,
           bool analyticsActive,
           bool liveFlag)
        {
            // Init
            Init(userId);

            _smfPlayer = playerInstance;
            SmartSwitch = smartswitch;
            IsAnalyticsActive = analyticsActive;
            IsLive = liveFlag;

            YouboraAvPlayerLog("Init", "YouboraAvPlayer Init - User:" + userId, LogType.Generic);

            Data(systemId);

            // Register events    
            _smfPlayer.Loaded += _smfPlayer_Loaded;
            _smfPlayer.MediaOpened += _smfPlayer_MediaOpened;
            _smfPlayer.MediaFailed += _smfPlayer_MediaFailed;
            _smfPlayer.PlayStateChanged += _smfPlayer_PlayStateChanged;
            _smfPlayer.ScrubbingStarted += _smfPlayer_ScrubbingStarted;
            _smfPlayer.ScrubbingCompleted += _smfPlayer_ScrubbingCompleted;
            _smfPlayer.PlaylistItemChanged += _smfPlayer_PlaylistItemChanged;
            _smfPlayer.PlaylistReachedEnd += _smfPlayer_PlaylistReachedEnd;
            _smfPlayer.PlaybackPositionChanged += _smfPlayer_PlaybackPositionChanged;
            _smfPlayer.PlaylistChanged += _smfPlayer_PlaylistChanged;
            _smfPlayer.Unloaded += _smfPlayer_Unloaded;
            _smfPlayer.VolumeLevelChanged += _smfPlayer_VolumeLevelChanged;
            _smfPlayer.PlaybackBitrateChanged += _smfPlayer_PlaybackBitrateChanged;
            _smfPlayer.IsMutedChanged += _smfPlayer_IsMutedChanged;
            _smfPlayer.BufferingProgressChanged += _smfPlayer_BufferingProgressChanged;
            _smfPlayer.DownloadProgressChanged += _smfPlayer_DownloadProgressChanged;
            _smfPlayer.RetryStateChanged += _smfPlayer_RetryStateChanged;
            _smfPlayer.MediaCommand += _smfPlayer_MediaCommand;

            _smfPlayer.Playlist.CollectionChanged += Playlist_CollectionChanged;
        }
Example #30
0
 /// <summary>
 /// Helper function to set the maximum ad bitrate in kbps
 /// </summary>
 /// <param name="player">The player to set the max bitrate</param>
 /// <param name="bitrate">The max bitrate in kbps</param>
 public static void SetMaxBitrateinKbps(SMFPlayer player, int bitrate)
 {
     player.GlobalConfigMetadata.Add(new Utilities.Metadata.MetadataItem() { Key = AdHandler.Key_MaxBitrateKbps, Value = bitrate });
 }
Example #31
0
 /// <summary>
 /// Helper function to set whether to prefer SmoothStreaming ads or not. 
 /// Set this to true to prefer smooth streaming ads when available, falling back on progressive when they are not.
 /// Set this to false to prefer progressive ads when available, falling back to smooth streaming when they are not.
 /// </summary>
 /// <param name="player">The player to set smooth streaming ad preference</param>
 /// <param name="enabled">The smooth streaming ad preference</param>
 public static void SetSmoothStreamingEnabled(SMFPlayer player, bool enabled)
 {
     player.GlobalConfigMetadata.Add(new Utilities.Metadata.MetadataItem() { Key = AdHandler.Key_IsSmoothEnabled, Value = enabled });
 }
Example #32
0
 /// <summary>
 /// Add a piece of content with an ad stream to the smf player's playlist
 /// </summary>
 /// <param name="player">The smf player to add the content to</param>
 /// <param name="contentUrl">The url to the content</param>
 /// <param name="method">The delivery method for the content (adaptive or progressive)</param>
 /// <param name="adUrl">The stream to the ad schedule</param>
 public static void AddContentWithAdToPlaylist(SMFPlayer player, string contentUrl, DeliveryMethods method, Stream adStream)
 {
     AddContentWithAdToPlaylistInternal(player, contentUrl, method, adStream, TimeSpan.Zero, "assetID");
 }
 internal string GetTitle(SMFPlayer player)
 {
     return (player != null && player.CurrentPlaylistItem != null) ? player.CurrentPlaylistItem.Title : string.Empty;           
 }
Example #34
0
 /// <summary>
 /// Add a piece of content with an ad url to the smf player's playlist
 /// </summary>
 /// <param name="player">The smf player to add the content to</param>
 /// <param name="contentUrl">The url to the content</param>
 /// <param name="method">The delivery method for the content (adaptive or progressive)</param>
 /// <param name="adUrl">The url to the ad schedule</param>
 /// <param name="startTime">The time in the content where playback will begin</param>
 /// <param name="assetID">The asset ID of the content that is being played</param>
 public static void AddContentWithAdToPlaylist(SMFPlayer player, string contentUrl, DeliveryMethods method, string adUrl, TimeSpan startTime, string assetID)
 {
     AddContentWithAdToPlaylistInternal(player, contentUrl, method, adUrl, startTime, assetID);
 }
        private void CreateNewSMFPlayer()
        {
            if (player != null) {
                player.PlayStateChanged -= OnPlayStateChanged;
                player.PlaylistReachedEnd += (sender, args) => {
                    if (NavigationService.CurrentSource.ToString() == "/VideoPage.xaml" && NavigationService.CanGoBack)
                        NavigationService.GoBack();
                };
                LayoutRoot.Children.Remove(player);
                player.Dispose();
            }

            player = new SMFPlayer {
                AutoPlay = true,
                VolumeLevel = 1.0,
                ContinuousPlay = true,
                PlaylistVisibility = FeatureVisibility.Visible
            };

            LayoutRoot.Children.Add(player);
            player.PlayStateChanged += OnPlayStateChanged;
        }
        /// <summary>
        /// Attaches the SMFPlayer so it can be monitored
        /// </summary>
        public void AttachToSMF(SMFPlayer smfPlayer)
        {
            smfPlayer.LogLevel = LogLevel.Information;
            CaptionsVisibility = smfPlayer.CaptionsVisibility;
            smfPlayer.CaptionsVisibilityChanged += smfPlayer_CaptionsVisibilityChanged;
            smfPlayer.AudioStreamChanged += smfPlayer_AudioStreamChanged;
            smfPlayer.RetryFailed += smfPlayer_RetryFailed;
            smfPlayer.RetrySuccessful += smfPlayer_RetrySuccessful;
            smfPlayer.PlayStateChanged += smfPlayer_PlayStateChanged;
            smfPlayer.PlaylistItemChanged += smfPlayer_PlaylistItemChanged;
#if PROGRAMMATICCOMPOSITION
            // get a list of logagents from the players generic plugins
            var logAgents = ((IPlayer)smfPlayer).Plugins.OfType<ILogAgent>().ToList();
            // merge the plugins with the existing ones
            LoggingService.Current.Agents = LoggingService.Current.Agents.Concat(logAgents).Distinct();
#endif
        }
 public void SetPlayer(FrameworkElement Player)
 {
     smf = Player as SMFPlayer;
 }