8cc1dbda4f
This PR adds react-native-windows support to react-native-video. The Video component is implemented with a XAML MediaPlayerElement. Most of the features implemented by Android (and some additional ones) are implemented by Windows. Known issues and missing features include: * onReadyForDisplay event * local URI convention (e.g., "broadchurch" in examples changed to require("./broadchurch.mp4") * `playableDuration` in `onVideoProgress` event is always 0.0 * `playInBackground` is not yet supported * Volume settings are applied, but the UWP control does not handle it properly
56 lines
1.1 KiB
C#
56 lines
1.1 KiB
C#
using ReactNative;
|
|
using ReactNative.Modules.Core;
|
|
using ReactNative.Shell;
|
|
using ReactNativeVideo;
|
|
using System.Collections.Generic;
|
|
using Windows.UI.Xaml.Media.Imaging;
|
|
|
|
namespace VideoPlayer
|
|
{
|
|
class MainPage : ReactPage
|
|
{
|
|
public override string MainComponentName
|
|
{
|
|
get
|
|
{
|
|
return "VideoPlayer";
|
|
}
|
|
}
|
|
|
|
#if BUNDLE
|
|
public override string JavaScriptBundleFile
|
|
{
|
|
get
|
|
{
|
|
return "ms-appx:///ReactAssets/index.windows.bundle";
|
|
}
|
|
}
|
|
#endif
|
|
|
|
public override List<IReactPackage> Packages
|
|
{
|
|
get
|
|
{
|
|
return new List<IReactPackage>
|
|
{
|
|
new MainReactPackage(),
|
|
new ReactVideoPackage(),
|
|
};
|
|
}
|
|
}
|
|
|
|
public override bool UseDeveloperSupport
|
|
{
|
|
get
|
|
{
|
|
#if !BUNDLE || DEBUG
|
|
return true;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|