"dependencies": {
"ElmSharp": "1.1.0-beta-021",
"Microsoft.NETCore.App": "1.1.1",
- "Tizen.Applications": "1.5.1",
+ "Tizen.Applications": "1.5.7",
"Tizen.Content.MediaContent": "1.0.19",
- "Tizen.Multimedia": "1.0.54",
+ "Tizen.Multimedia": "1.2.0",
+ "Tizen.Multimedia.MediaPlayer": "1.0.0",
"Tizen.Xamarin.Forms.Extension": "2.3.5-r233-002",
"Xamarin.Forms": "2.3.5-r233-004",
"Xamarin.Forms.Platform.Tizen": "2.3.5-r233-004"
xmlns:ViewModels="clr-namespace:TVMediaHub.Tizen.ViewModels"
xmlns:Controls="clr-namespace:TVMediaHub.Tizen.Controls"
CurrentVideo="{Binding CurrentVideo}">
- <RelativeLayout>
- <!--TODO : It should be changed to MediaView -->
+ <RelativeLayout x:Name="MainLayout">
<Image x:Name="Thumbnail"
RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=1}"
RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0}"
RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0}"
Source="img_gradient_topbottom.9.png" />
-
<Label x:Name="TitleLabel"
Text="{Binding CurrentVideo.Title}"
FontFamily="BreezeSans"
using TVMediaHub.Tizen.ViewModels;
using TVMediaHub.Tizen.Controls;
using Xamarin.Forms;
+using Extension = Tizen.Xamarin.Forms.Extension;
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
namespace TVMediaHub.Tizen.Views
private Player playerInstance;
/// <summary>
- /// The window of the full screen
+ /// The instance of the player display
/// </summary>
- private ElmSharp.Window fullScreenWindow;
-#if MULTIMEDIA_API_VERSION_1_0_55
private Display playerDisplayInstance;
-#else
+
/// <summary>
- /// The instance of the player display
+ /// The instance of the media view
/// </summary>
- private PlayerDisplay playerDisplayInstance;
-#endif
+ private Extension.MediaView mediaView;
+
/// <summary>
/// The media source
/// </summary>
InitializeComponent();
InitializeFontSize();
- InitializePlayerDisplay();
- InitializePlayer();
- PrepareAsync();
+ mediaView = new Extension.MediaView();
+
+ mediaView.NativeViewCreated += (s, e) =>
+ {
+ InitializePlayerDisplay();
+ InitializePlayer();
+ PrepareAsync();
+ };
+
+ mediaView.IsVisible = true;
+ mediaView.WidthRequest = 1920;
+ mediaView.HeightRequest = 1080;
+ MainLayout.Children.Insert(3, mediaView);
+
InitializeButtons();
- OnBackButtonPressedHandler += async (s, e) =>
+ OnBackButtonPressedHandler += async (s, e) =>
{
try
{
playerInstance?.Stop();
playerInstance?.Unprepare();
- fullScreenWindow?.Hide();
}
catch (Exception ex)
{
/// </summary>
private void InitializePlayerDisplay()
{
- // Create Player Display and Window
- fullScreenWindow = new ElmSharp.Window("MediaPlayer");
- fullScreenWindow.Resize(1920, 1080);
- fullScreenWindow.Realize(null);
- fullScreenWindow.Active();
- fullScreenWindow.Show();
- // TODO: Remove this later, only for TDC
- fullScreenWindow.Hide();
-
- fullScreenWindow.KeyUp += (sender, evasKeyEventArg) =>
- {
- DbgPort.D("KeyPreessed : " + evasKeyEventArg.KeyName);
-
- if (evasKeyEventArg.KeyName.CompareTo(ElmSharp.EvasKeyEventArgs.PlatformBackButtonName) == 0)
- {
- DbgPort.D("Back Key Pressed. Hide Player window");
- try
- {
- playerInstance.Stop();
- playerInstance.Unprepare();
- }
- catch (Exception ex)
- {
- DbgPort.E("Stop Failed : " + ex.Message);
- }
-
- fullScreenWindow.Hide();
-
- PausePlayBtn.NormalImage = PausePlayBtn.NormalImage.Replace("pause", "play");
- PausePlayBtn.PressedImage = PausePlayBtn.PressedImage.Replace("pause", "play");
- PausePlayBtn.MediaHubButtonIcon = PausePlayBtn.NormalImage;
-
- SetControlAreaState(ControlAreaState.AUTO);
- }
- };
- DbgPort.D("ElmSharp.Window has been created");
-#if MULTIMEDIA_API_VERSION_1_0_55
- playerDisplayInstance = new Display(fullScreenWindow);
-#else
- playerDisplayInstance = new PlayerDisplay(fullScreenWindow);
-#endif
+ playerDisplayInstance = new Display((MediaView)mediaView.NativeView);
DbgPort.D("Player Display has been created");
}
DbgPort.E("Stop Failed : " + ex.Message);
}
- fullScreenWindow.Hide();
-
PausePlayBtn.NormalImage = PausePlayBtn.NormalImage.Replace("pause", "play");
PausePlayBtn.PressedImage = PausePlayBtn.PressedImage.Replace("pause", "play");
PausePlayBtn.MediaHubButtonIcon = PausePlayBtn.NormalImage;