When I click on the fullscreen button of the player, the silverlight window fill up my page, but the video player keeps its normal size.
Tough I get the message to "click on the escape keyboard touch to close the fullscreen view".
here is my code, what am I missing please ?
Regards and thanks in advance
in my xaml
|
<Border Grid.Row="2" Theme:StyleManager.Style="Grid_Background_Style" HorizontalAlignment="Left"> <!-- SELECTED ELEMENT DETAILS --> <StackPanel Orientation="Vertical" VerticalAlignment="Bottom"> |
| <player:RadMediaPlayer x:Name="player" |
| Header="{Binding RelativeSource={RelativeSource Self}, Path=MediaElement}" |
| SelectedIndex="0" FullScreenChanged="player_FullScreenChanged"> |
| <player:RadMediaItem IsStreamingSource="True" Header="Big Buck Bunny" |
| Source="http://video3.smoothhd.com.edgesuite.net/ondemand/Big Buck Bunny Adaptive.ism/Manifest" |
| StreamAttached="RadMediaItem_StreamAttached"> |
| </player:RadMediaItem> |
| </player:RadMediaPlayer> |
in my .cs
| private void player_FullScreenChanged(object sender, EventArgs e) |
| { |
| Application.Current.Host.Content.IsFullScreen = !Application.Current.Host.Content.IsFullScreen; |
| } |
17 Answers, 1 is accepted
Is there a way to have just the mediaplayer opening in the popup window ?
Regards, and thanks for your great work
Currently we don't support full screen functionality out-of-the box, but we leave this as application logic. Which means we raise the FullScreenChanged event and you should handle it in your code and for example you can make the whole app in full screen, but the player will be still at the same position.
We will implement the full functionality for the next Q, but till then you can try this code if it will works good for you.
public partial class MainPage : UserControl{ private TimeSpan currentMediaElementPosition; private Popup popUp = new Popup(); public MainPage() { InitializeComponent(); Application.Current.Host.Content.FullScreenChanged += Content_FullScreenChanged; } private void Content_FullScreenChanged(object sender, EventArgs e) { Debug.WriteLine("Content FSCh"); this.currentMediaElementPosition = player.MediaElement.Position; if (Application.Current.Host.Content.IsFullScreen) { player.Width = Application.Current.Host.Content.ActualWidth; player.Height = Application.Current.Host.Content.ActualHeight; popUp.IsOpen = true; LayoutRoot.Children.Remove(player); popUp.Child = player; } else { player.Width = Double.NaN; player.Height = Double.NaN; popUp.Child = null; if (!LayoutRoot.Children.Contains(player)) { LayoutRoot.Children.Add(player); } } player.IsFullScreen = Application.Current.Host.Content.IsFullScreen; } private void player_FullScreenChanged(object sender, EventArgs e) { player.MediaOpened += player_MediaOpened; Application.Current.Host.Content.IsFullScreen = player.IsFullScreen; } private void player_MediaOpened(object sender, Telerik.Windows.RadRoutedEventArgs e) { player.MediaElement.Position = this.currentMediaElementPosition; }}This code inserts the player in a stretched Popup. Although it is not working perfectly, you may give it a try.
Thank you.
Regards,
Miro Miroslavov
the Telerik team
I just integrated your code sample in my project, and it should work fine, but I get an ArgumentException , and Visual Studio 2008 even freezes totally oO
Here is the error :
[i]ArgumentException was unhandled by user code
La valeur n'est pas comprise dans la plage attendue[/i]
and it points to the following line code :
if (Application.Current.Host.Content.IsFullScreen)
{
player.Width = Application.Current.Host.Content.ActualWidth;
player.Height = Application.Current.Host.Content.ActualHeight;
popUp.IsOpen = true;
LayoutRoot.Children.Remove(player);
popUp.Child = player; <------------------ HERE is the bug message
}
When you have
Application.Current.Host.Content.FullScreenChanged handler, you can not debug the application. When you debug it - the VS and everything freeze.Can you please find the attached project and check if you can reproduce it there.
All the best,
Miro Miroslavov
the Telerik team
Alas for your project as for mine, it won't work either in Debug or In Release.
The same error message occurs, and the entire environment freezes.
It's odd, by the way, that even in Release it freezes. I hope you will have more response for me.
thanks in advance and regards
I just found out something that may explain the problem.
My Player is included in a dashboard window, that includes two gridview and more infos.
If I just copy/paste my code in a bran new project , the full screen handler works perfectly.
If I try to open the full screen in my dashboard, the application freezes.
It seems curious to think you can't open a popup full screen player in a window that contains other elements.
Here is a picture of my screen so you can understand what I'm trying to do.
Is that a thing I'm misunderstanding or a bug ?
Regards
This is really strange. It is not supposed to have problems if having other elements or not.
Is it possible to send us example project that demonstrates the problem? So we will be able to reproduce it and give you advice or workaround.
Thank you.
Greetings,
Miro Miroslavov
the Telerik team
the example you ask for have been sent to your service via the 327102 Telerik Ticket, as I wasn't able to put it into another storage or link.
Best Regards
Hoping you'll find out what's wrong
Answered in ticket: 327102.
Best wishes,
Miro Miroslavov
the Telerik team
Thanks for the solution, it works fine with me.
Just by curiosity, do you know why it won't work with smooth streaming video ? and it seems clicking on the full screen button stops the video running. Is that normal ? DO I need to create a method to start the video streaming again ?
Regards
When you click the full screen button, what happens is that removing the MediaPlayer from the visual tree (removing it from the panel) causes the video to stop and drop the connection to the server. When we add it in the Popup it starts again but from the beginning and should be positioned at the same place where it was stopped. This actual restarting of the video is causing side effects when it is smooth streaming video. (It is a internal problem of the smooth streaming media element).
However we will fix our media player to support full screen more naturally - there is public issue for that where you can vote for it, so will raise its priority.
Kind regards,
Miro Miroslavov
the Telerik team
I have the same issue as Fred.
When the full screen fix would be released ?
Regards.
Sébastien.
You can track this feature progeress here.
It will be also ready for the Beta release of Q3 or even sooner. (after a month from now)
Hope this time frame is good for you.
Kind regards,
Miro Miroslavov
the Telerik team
thanks for the answer.
I succeeded to show video in full screen mode using the sample code you posted.
We will use it until you released the fix,
Regards,
Sébastien
Yesterday we've release Q3 2010 version of RadControls For Silverlight, which includes MediaPlayer native full screen support and a lot more fixes of the player itself.
Can you give it a try and let us know if you still have problems with it.
Thank you for your cooperation.
Miro Miroslavov
the Telerik team