Initial commit
43
SimpliPlay UWP.sln
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.14.36327.8 d17.14
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpliPlay UWP", "SimpliPlay UWP\SimpliPlay UWP.csproj", "{B5AAB9A4-6261-409E-A9CE-BC599137E959}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|arm64 = Debug|arm64
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|arm64 = Release|arm64
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|arm64.ActiveCfg = Debug|arm64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|arm64.Build.0 = Debug|arm64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|arm64.Deploy.0 = Debug|arm64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|x64.Deploy.0 = Debug|x64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|arm64.ActiveCfg = Release|arm64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|arm64.Build.0 = Release|arm64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|arm64.Deploy.0 = Release|arm64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|x64.Build.0 = Release|x64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|x64.Deploy.0 = Release|x64
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|x86.Build.0 = Release|x86
|
||||||
|
{B5AAB9A4-6261-409E-A9CE-BC599137E959}.Release|x86.Deploy.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {60348CF2-DE74-4380-84F1-A5D3876BE9CC}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
BIN
SimpliPlay UWP/.DS_Store
vendored
Normal file
8
SimpliPlay UWP/App.xaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<Application
|
||||||
|
x:Class="SimpliPlay.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
RequestedTheme="Light">
|
||||||
|
<Application.Resources>
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
31
SimpliPlay UWP/App.xaml.cs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
using Windows.ApplicationModel.Activation;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
|
||||||
|
namespace SimpliPlay
|
||||||
|
{
|
||||||
|
sealed partial class App : Application
|
||||||
|
{
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnLaunched(LaunchActivatedEventArgs e)
|
||||||
|
{
|
||||||
|
Frame rootFrame = Window.Current.Content as Frame;
|
||||||
|
|
||||||
|
if (rootFrame == null)
|
||||||
|
{
|
||||||
|
rootFrame = new Frame();
|
||||||
|
Window.Current.Content = rootFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rootFrame.Content == null)
|
||||||
|
{
|
||||||
|
rootFrame.Navigate(typeof(MainPage), e.Arguments);
|
||||||
|
}
|
||||||
|
Window.Current.Activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
SimpliPlay UWP/Assets/LockScreenLogo.scale-200.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
SimpliPlay UWP/Assets/SplashScreen.scale-200.png
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
SimpliPlay UWP/Assets/Square150x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
SimpliPlay UWP/Assets/Square44x44Logo.scale-200.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
BIN
SimpliPlay UWP/Assets/StoreLogo.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
SimpliPlay UWP/Assets/Wide310x150Logo.scale-200.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
11
SimpliPlay UWP/MainPage.xaml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<Page
|
||||||
|
x:Class="SimpliPlay.MainPage"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<!-- UWP WebView -->
|
||||||
|
<WebView x:Name="MyWebView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
32
SimpliPlay UWP/MainPage.xaml.cs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
using System;
|
||||||
|
using Windows.Storage;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace SimpliPlay
|
||||||
|
{
|
||||||
|
public sealed partial class MainPage : Page
|
||||||
|
{
|
||||||
|
public MainPage()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
LoadLocalHtml();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void LoadLocalHtml()
|
||||||
|
{
|
||||||
|
// Get the installed location of the app
|
||||||
|
var folder = Package.Current.InstalledLocation;
|
||||||
|
|
||||||
|
// Ensure you have the correct path to the index.html file
|
||||||
|
var file = await folder.GetFileAsync(@"WebAssets\index.html");
|
||||||
|
|
||||||
|
// Correctly form the URI to point to the local HTML file
|
||||||
|
var uri = new Uri($"ms-appx-web:///{file.Path.Replace('\\', '/')}");
|
||||||
|
|
||||||
|
// Load the HTML file into the WebView
|
||||||
|
MyWebView.Navigate(uri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
SimpliPlay UWP/Package.appxmanifest
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<Package
|
||||||
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
IgnorableNamespaces="uap mp">
|
||||||
|
|
||||||
|
<Identity
|
||||||
|
Name="fb5de0c8-508b-4a30-8cea-7fcd7e832e56"
|
||||||
|
Publisher="CN=Anirudh"
|
||||||
|
Version="1.0.0.0" />
|
||||||
|
|
||||||
|
<mp:PhoneIdentity PhoneProductId="fb5de0c8-508b-4a30-8cea-7fcd7e832e56" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>SimpliPlay_UWP</DisplayName>
|
||||||
|
<PublisherDisplayName>Anirudh</PublisherDisplayName>
|
||||||
|
<Logo>Assets\StoreLogo.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||||
|
</Dependencies>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="x-generate"/>
|
||||||
|
</Resources>
|
||||||
|
|
||||||
|
<Applications>
|
||||||
|
<Application Id="App"
|
||||||
|
Executable="$targetnametoken$.exe"
|
||||||
|
EntryPoint="SimpliPlay_UWP.App">
|
||||||
|
<uap:VisualElements
|
||||||
|
DisplayName="SimpliPlay_UWP"
|
||||||
|
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||||
|
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||||
|
Description="SimpliPlay_UWP"
|
||||||
|
BackgroundColor="transparent">
|
||||||
|
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||||
|
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||||
|
</uap:VisualElements>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
|
||||||
|
<Capabilities>
|
||||||
|
<Capability Name="internetClient" />
|
||||||
|
</Capabilities>
|
||||||
|
</Package>
|
BIN
SimpliPlay UWP/Properties/.DS_Store
vendored
Normal file
7
SimpliPlay UWP/Properties/launchSettings.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"profiles": {
|
||||||
|
"SimpliPlay_UWP": {
|
||||||
|
"commandName": "MsixPackage"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
SimpliPlay UWP/SimpliPlay UWP.csproj
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
|
||||||
|
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<UseUwp>true</UseUwp>
|
||||||
|
<Platforms>x86;x64;arm64</Platforms>
|
||||||
|
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<PublishAot>true</PublishAot>
|
||||||
|
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
|
||||||
|
<DisableRuntimeMarshalling>true</DisableRuntimeMarshalling>
|
||||||
|
<EnableMsixTooling>true</EnableMsixTooling>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
BIN
SimpliPlay UWP/WebAssets/fonts/Inter_18pt-Regular.ttf
Normal file
BIN
SimpliPlay UWP/WebAssets/fonts/Inter_24pt-Bold.ttf
Normal file
2
SimpliPlay UWP/WebAssets/fonts/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# fonts
|
||||||
|
folder for custom fonts
|
96
SimpliPlay UWP/WebAssets/index.html
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<script src="player.js"></script>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="
|
||||||
|
default-src 'self';
|
||||||
|
script-src 'self';
|
||||||
|
style-src 'self';
|
||||||
|
img-src 'self' data:;
|
||||||
|
media-src * blob: file:;
|
||||||
|
connect-src *;
|
||||||
|
font-src 'self';
|
||||||
|
object-src 'none';
|
||||||
|
child-src 'none';
|
||||||
|
form-action 'self';
|
||||||
|
worker-src 'self' blob:;
|
||||||
|
">
|
||||||
|
|
||||||
|
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
|
||||||
|
<link rel="stylesheet" href="styles.css">
|
||||||
|
<script src="lib/dash.js"></script>
|
||||||
|
<script src="lib/hls.js"></script>
|
||||||
|
<script src="lib/directional-navigation-1.0.0.0.js"></script>
|
||||||
|
<script src="lib/redirectconsole-1.0.0.0.js"></script>
|
||||||
|
<title>SimpliPlay</title>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>SimpliPlay</h1>
|
||||||
|
<div class="dialog-overlay" id="dialogOverlay">
|
||||||
|
<div class="dialog">
|
||||||
|
<p>Select how you want to load media:</p>
|
||||||
|
<button id="chooseFileBtn">Choose a File</button>
|
||||||
|
<button id="enterUrlBtn">Enter a URL</button>
|
||||||
|
<button id="hideDialogBtn">Go back</button>
|
||||||
|
<input type="file" id="fileInput" accept="video/*,audio/*">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dialog-overlay" id="urlDialogOverlay">
|
||||||
|
<div class="dialog">
|
||||||
|
<p>Enter media URL:</p>
|
||||||
|
<input type="url" id="urlInput" placeholder="Enter media URL here">
|
||||||
|
<button id="submitUrlBtn">Submit</button>
|
||||||
|
<button id="cancelUrlBtn">Cancel</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="subtitles-overlay" id="subtitlesOverlay">
|
||||||
|
<div class="subtitles-dialog">
|
||||||
|
<p>Enter subtitles URL:</p>
|
||||||
|
<input type="url" id="subtitlesInput" placeholder="Enter subtitles URL here">
|
||||||
|
<button id="submitSubtitlesBtn">Submit</button>
|
||||||
|
<button id="cancelSubtitlesBtn">Cancel</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<video id="mediaPlayer" autoplay controls></video>
|
||||||
|
|
||||||
|
<div id="customControls">
|
||||||
|
<button id="playPauseBtn">Pause</button>
|
||||||
|
<input type="range" id="seekBar" min="0" value="0" step="0.1">
|
||||||
|
<span id="timeDisplay">00:00 / 00:00</span>
|
||||||
|
<button id="volumeBtn">🔊</button>
|
||||||
|
<input type="range" id="volumeBar" min="0" max="1" step="0.1" value="1">
|
||||||
|
<button id="fullscreenBtn">⛶</button>
|
||||||
|
<button id="ccBtn">Add Subtitles</button> <!-- CC button -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="gap-box"></div>
|
||||||
|
<button id="showDialogBtn">Play more media</button>
|
||||||
|
|
||||||
|
<!-- Settings gear button -->
|
||||||
|
<button id="settingsBtn">⚙️</button>
|
||||||
|
|
||||||
|
<!-- Settings panel -->
|
||||||
|
<div class="dialog-overlay" id="settingsDialogOverlay">
|
||||||
|
<div id="settingsPanel">
|
||||||
|
<label for="autoplayCheckbox">Autoplay:</label>
|
||||||
|
<input type="checkbox" id="autoplayCheckbox" checked><br>
|
||||||
|
<label for="loopCheckbox">Loop:</label>
|
||||||
|
<input type="checkbox" id="loopCheckbox"><br>
|
||||||
|
<label for="controlsCheckbox">Controls:</label>
|
||||||
|
<input type="checkbox" id="controlsCheckbox" checked><br>
|
||||||
|
<label for="controlsCheckbox">Vivid Colors:</label>
|
||||||
|
<input type="checkbox" id="colorsCheckbox"><br>
|
||||||
|
<p class="settings-info"><em>Settings apply for this session only.</em></p>
|
||||||
|
<button id="saveSettingsBtn">Save Settings</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
14
SimpliPlay UWP/WebAssets/lib/dash-LICENSE.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# dash.js BSD License Agreement
|
||||||
|
|
||||||
|
The copyright in this software is being made available under the BSD License, included below. This software may be subject to other third party and contributor rights, including patent rights, and no such rights are granted under this license.
|
||||||
|
|
||||||
|
**Copyright (c) 2015, Dash Industry Forum.
|
||||||
|
**All rights reserved.**
|
||||||
|
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Dash Industry Forum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
**THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.**
|
||||||
|
|
3
SimpliPlay UWP/WebAssets/lib/dash.js
Normal file
1015
SimpliPlay UWP/WebAssets/lib/directionalnavigation-1.0.0.0.js
Normal file
28
SimpliPlay UWP/WebAssets/lib/hls-LICENSE.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
Copyright (c) 2017 Dailymotion (http://www.dailymotion.com)
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
src/remux/mp4-generator.js and src/demux/exp-golomb.ts implementation in this project
|
||||||
|
are derived from the HLS library for video.js (https://github.com/videojs/videojs-contrib-hls)
|
||||||
|
|
||||||
|
That work is also covered by the Apache 2 License, following copyright:
|
||||||
|
Copyright (c) 2013-2015 Brightcove
|
||||||
|
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
2
SimpliPlay UWP/WebAssets/lib/hls.js
Normal file
44
SimpliPlay UWP/WebAssets/lib/redirectconsole-1.0.0.0.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) Microsoft Corporation.
|
||||||
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
|
// This library redirects JavaScript console function calls to also pass their string
|
||||||
|
// payload along to window.external.notify, so that a UWP application can catch and log
|
||||||
|
// them to the Visual Studio console. Note that line numbers are lost in this process.
|
||||||
|
//
|
||||||
|
// This is useful for Visual Studio 2019 and later, as they lack built-in debugging
|
||||||
|
// tools for the original WebView control. If you are using Visual Studio 2017, you are
|
||||||
|
// better off using the built-in Script debugging tools instead.
|
||||||
|
(function () {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
if (typeof (window.external) !== "undefined" && ("notify" in window.external))
|
||||||
|
{
|
||||||
|
let oldLog = window.console.log;
|
||||||
|
window.console.log = function (text) {
|
||||||
|
window.external.notify(" [JS Console Log] " + text);
|
||||||
|
oldLog.apply(window.console, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
let oldInfo = window.console.info;
|
||||||
|
window.console.info = function (text) {
|
||||||
|
window.external.notify(" [JS Console Info] " + text);
|
||||||
|
oldInfo.apply(window.console, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
let oldWarn = window.console.warn;
|
||||||
|
window.console.warn = function (text) {
|
||||||
|
window.external.notify(" [JS Console Warn] " + text);
|
||||||
|
oldWarn.apply(window.console, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
let oldError = window.console.error;
|
||||||
|
window.console.error = function (text) {
|
||||||
|
window.external.notify("[JS Console Error] " + text);
|
||||||
|
oldError.apply(window.console, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onerror = function (text) {
|
||||||
|
window.external.notify("[JS Console Error] " + text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
28
SimpliPlay UWP/WebAssets/licenses/HLS-js-LICENSE.txt
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
Copyright (c) 2017 Dailymotion (http://www.dailymotion.com)
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
src/remux/mp4-generator.js and src/demux/exp-golomb.ts implementation in this project
|
||||||
|
are derived from the HLS library for video.js (https://github.com/videojs/videojs-contrib-hls)
|
||||||
|
|
||||||
|
That work is also covered by the Apache 2 License, following copyright:
|
||||||
|
Copyright (c) 2013-2015 Brightcove
|
||||||
|
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
92
SimpliPlay UWP/WebAssets/licenses/Inter-font-LICENSE.txt
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
||||||
|
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION AND CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
14
SimpliPlay UWP/WebAssets/licenses/dash-js-LICENSE.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# dash.js BSD License Agreement
|
||||||
|
|
||||||
|
The copyright in this software is being made available under the BSD License, included below. This software may be subject to other third party and contributor rights, including patent rights, and no such rights are granted under this license.
|
||||||
|
|
||||||
|
**Copyright (c) 2015, Dash Industry Forum.
|
||||||
|
**All rights reserved.**
|
||||||
|
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the Dash Industry Forum nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
**THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.**
|
||||||
|
|
380
SimpliPlay UWP/WebAssets/player.js
Normal file
@ -0,0 +1,380 @@
|
|||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
|
const dialogOverlay = document.getElementById('dialogOverlay');
|
||||||
|
const chooseFileBtn = document.getElementById('chooseFileBtn');
|
||||||
|
const enterUrlBtn = document.getElementById('enterUrlBtn');
|
||||||
|
const fileInput = document.getElementById('fileInput');
|
||||||
|
const mediaPlayer = document.getElementById('mediaPlayer');
|
||||||
|
const playPauseBtn = document.getElementById('playPauseBtn');
|
||||||
|
const seekBar = document.getElementById('seekBar');
|
||||||
|
const timeDisplay = document.getElementById('timeDisplay');
|
||||||
|
const volumeBar = document.getElementById('volumeBar');
|
||||||
|
const settingsBtn = document.getElementById('settingsBtn');
|
||||||
|
const settingsPanel = document.getElementById('settingsPanel');
|
||||||
|
const autoplayCheckbox = document.getElementById('autoplayCheckbox');
|
||||||
|
const loopCheckbox = document.getElementById('loopCheckbox');
|
||||||
|
const saveSettingsBtn = document.getElementById('saveSettingsBtn');
|
||||||
|
const urlDialogOverlay = document.getElementById('urlDialogOverlay');
|
||||||
|
const settingsDialogOverlay = document.getElementById('settingsDialogOverlay');
|
||||||
|
const urlInput = document.getElementById('urlInput');
|
||||||
|
const submitUrlBtn = document.getElementById('submitUrlBtn');
|
||||||
|
const cancelUrlBtn = document.getElementById('cancelUrlBtn');
|
||||||
|
const ccBtn = document.getElementById('ccBtn'); // CC button
|
||||||
|
const volumeBtn = document.getElementById("volumeBtn")
|
||||||
|
const subtitlesOverlay = document.getElementById('subtitlesOverlay');
|
||||||
|
const subtitlesInput = document.getElementById('subtitlesInput');
|
||||||
|
const submitSubtitlesBtn = document.getElementById('submitSubtitlesBtn');
|
||||||
|
const cancelSubtitlesBtn = document.getElementById('cancelSubtitlesBtn');
|
||||||
|
const customControls = document.getElementById('customControls');
|
||||||
|
let hls = null
|
||||||
|
let player = null
|
||||||
|
|
||||||
|
// Update media volume when the slider is moved
|
||||||
|
volumeBar.addEventListener("input", function () {
|
||||||
|
mediaPlayer.volume = volumeBar.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sync slider with media volume (in case it's changed programmatically)
|
||||||
|
mediaPlayer.addEventListener("volumechange", function () {
|
||||||
|
volumeBar.value = mediaPlayer.volume;
|
||||||
|
if (mediaPlayer.muted || mediaPlayer.volume === 0) {
|
||||||
|
volumeBtn.textContent = "🔇";
|
||||||
|
} else {
|
||||||
|
volumeBtn.textContent = "🔊";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Function to add subtitles dynamically (e.g., after URL input)
|
||||||
|
function addSubtitles(url) {
|
||||||
|
// Remove any existing subtitle tracks
|
||||||
|
const existingTracks = mediaPlayer.getElementsByTagName('track');
|
||||||
|
for (let track of existingTracks) {
|
||||||
|
track.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new track for subtitles
|
||||||
|
const track = document.createElement('track');
|
||||||
|
track.kind = 'subtitles';
|
||||||
|
track.label = 'English';
|
||||||
|
track.srclang = 'en';
|
||||||
|
track.src = url;
|
||||||
|
|
||||||
|
// Append the new track
|
||||||
|
mediaPlayer.appendChild(track);
|
||||||
|
|
||||||
|
// Optionally, enable subtitles by default
|
||||||
|
track.track.mode = 'showing'; // Enable subtitles by default
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle submit subtitle URL
|
||||||
|
function clearSubtitles() {
|
||||||
|
const tracks = mediaPlayer.getElementsByTagName('track');
|
||||||
|
for (let i = tracks.length - 1; i >= 0; i--) {
|
||||||
|
tracks[i].remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use this function when a new video is loaded
|
||||||
|
|
||||||
|
submitSubtitlesBtn.addEventListener('click', () => {
|
||||||
|
const subtitleUrl = subtitlesInput.value;
|
||||||
|
if (subtitleUrl) {
|
||||||
|
addSubtitles(subtitleUrl);
|
||||||
|
subtitlesOverlay.style.display = 'none';
|
||||||
|
subtitlesInput.value = '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let autoplayEnabled = true;
|
||||||
|
let loopEnabled = false;
|
||||||
|
|
||||||
|
// Handle submit URL button in custom dialog
|
||||||
|
submitUrlBtn.addEventListener('click', () => {
|
||||||
|
let url = urlInput.value;
|
||||||
|
|
||||||
|
// Check if URL is a valid URL and doesn't contain "http" or "https"
|
||||||
|
if (url && !url.startsWith('http') && !url.startsWith('https')) {
|
||||||
|
// Assuming it's a URL and needs the protocol added
|
||||||
|
url = 'http://' + url; // You can also choose 'https://' if preferred
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (url) {
|
||||||
|
clearSubtitles();
|
||||||
|
if (hls !== null) {
|
||||||
|
hls.destroy()
|
||||||
|
hls = null
|
||||||
|
}
|
||||||
|
if (player !== null) {
|
||||||
|
player.reset()
|
||||||
|
player = null
|
||||||
|
}
|
||||||
|
if (url.toLowerCase().endsWith('.m3u8') || url.toLowerCase().endsWith('.m3u')) {
|
||||||
|
// HLS stream
|
||||||
|
if (Hls.isSupported()) {
|
||||||
|
mediaPlayer.style.display = 'flex'; // Hide the native video player
|
||||||
|
hls = new Hls();
|
||||||
|
mediaPlayer.pause();
|
||||||
|
hls.loadSource(url);
|
||||||
|
hls.attachMedia(mediaPlayer);
|
||||||
|
hls.on(Hls.Events.MANIFEST_PARSED, function() {
|
||||||
|
if (autoplayCheckbox.checked) {
|
||||||
|
mediaPlayer.play();
|
||||||
|
}
|
||||||
|
urlInput.value = "";
|
||||||
|
customControls.style.display = 'flex';
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
alert("Your device doesn't support HLS.");
|
||||||
|
customControls.style.display = 'flex';
|
||||||
|
urlInput.value = "";
|
||||||
|
}
|
||||||
|
} else if (url.toLowerCase().endsWith('.mpd')) {
|
||||||
|
mediaPlayer.style.display = 'flex'; // Hide the native video player
|
||||||
|
mediaPlayer.pause();
|
||||||
|
player = dashjs.MediaPlayer().create();
|
||||||
|
// MPEG-DASH stream
|
||||||
|
player.initialize(mediaPlayer, url, true);
|
||||||
|
customControls.style.display = 'flex';
|
||||||
|
urlInput.value = "";
|
||||||
|
if (autoplayCheckbox.checked) {
|
||||||
|
mediaPlayer.play();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
mediaPlayer.style.display = 'flex'; // Hide the native video player
|
||||||
|
mediaPlayer.pause();
|
||||||
|
mediaPlayer.src = url;
|
||||||
|
customControls.style.display = 'flex';
|
||||||
|
urlInput.value = "";
|
||||||
|
if (autoplayCheckbox.checked) {
|
||||||
|
mediaPlayer.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
urlDialogOverlay.style.display = 'none';
|
||||||
|
dialogOverlay.style.display = 'none';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Handle CC button to show subtitle modal
|
||||||
|
ccBtn.addEventListener('click', () => {
|
||||||
|
subtitlesOverlay.style.display = 'block';
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Handle cancel subtitle modal
|
||||||
|
cancelSubtitlesBtn.addEventListener('click', () => {
|
||||||
|
subtitlesOverlay.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Show the dialog on page load
|
||||||
|
window.onload = function () {
|
||||||
|
dialogOverlay.style.display = 'block';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Handle "Choose a File" button
|
||||||
|
chooseFileBtn.addEventListener('click', () => {
|
||||||
|
fileInput.click();
|
||||||
|
});
|
||||||
|
|
||||||
|
mediaPlayer.addEventListener("volumechange", function () {
|
||||||
|
if (mediaPlayer.muted) {
|
||||||
|
volumeBtn.textContent = "🔇"
|
||||||
|
} else if (mediaPlayer.volume === 0) {
|
||||||
|
volumeBtn.textContent = "🔊"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let previousObjectURL = null; // Store the last Object URL
|
||||||
|
|
||||||
|
fileInput.addEventListener('change', (event) => {
|
||||||
|
if (hls !== null) {
|
||||||
|
hls.destroy()
|
||||||
|
hls = null
|
||||||
|
}
|
||||||
|
if (player !== null) {
|
||||||
|
player.reset()
|
||||||
|
player = null
|
||||||
|
}
|
||||||
|
const file = event.target.files[0];
|
||||||
|
if (!file) return;
|
||||||
|
|
||||||
|
clearSubtitles(); // Remove any previously loaded subtitles
|
||||||
|
|
||||||
|
// Revoke the previous Object URL if it exists
|
||||||
|
if (previousObjectURL) {
|
||||||
|
URL.revokeObjectURL(previousObjectURL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new Object URL for the selected file
|
||||||
|
const fileURL = URL.createObjectURL(file);
|
||||||
|
mediaPlayer.src = fileURL;
|
||||||
|
mediaPlayer.load();
|
||||||
|
if (autoplayCheckbox.checked) {
|
||||||
|
mediaPlayer.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Store the new Object URL for future cleanup
|
||||||
|
previousObjectURL = fileURL;
|
||||||
|
|
||||||
|
// Hide dialog after selecting a file
|
||||||
|
dialogOverlay.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Handle "Enter a URL" button
|
||||||
|
enterUrlBtn.addEventListener('click', () => {
|
||||||
|
urlDialogOverlay.style.display = 'block';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle cancel button in URL dialog
|
||||||
|
cancelUrlBtn.addEventListener('click', () => {
|
||||||
|
urlDialogOverlay.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle custom play/pause button
|
||||||
|
playPauseBtn.addEventListener('click', () => {
|
||||||
|
if (mediaPlayer.paused) {
|
||||||
|
mediaPlayer.play();
|
||||||
|
playPauseBtn.textContent = 'Pause';
|
||||||
|
} else {
|
||||||
|
mediaPlayer.pause();
|
||||||
|
playPauseBtn.textContent = 'Play';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sync button with the video player when it is paused manually
|
||||||
|
mediaPlayer.addEventListener('pause', () => {
|
||||||
|
playPauseBtn.textContent = 'Play';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Sync button with the video player when it is played
|
||||||
|
mediaPlayer.addEventListener('play', () => {
|
||||||
|
playPauseBtn.textContent = 'Pause';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Volume button toggling mute/unmute
|
||||||
|
volumeBtn.addEventListener('click', () => {
|
||||||
|
if (mediaPlayer.muted || mediaPlayer.volume == 0) {
|
||||||
|
mediaPlayer.muted = false;
|
||||||
|
volumeBtn.textContent = '🔊'; // Unmute icon
|
||||||
|
} else {
|
||||||
|
mediaPlayer.muted = true;
|
||||||
|
volumeBtn.textContent = '🔇'; // Mute icon
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Handle URL input on Enter key
|
||||||
|
urlInput.addEventListener('keydown', (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
submitUrlBtn.click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle Subtitles input on Enter key
|
||||||
|
subtitlesInput.addEventListener('keydown', (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
submitSubtitlesBtn.click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle URL submission
|
||||||
|
|
||||||
|
|
||||||
|
// Update seek bar and time display
|
||||||
|
mediaPlayer.addEventListener('timeupdate', () => {
|
||||||
|
seekBar.max = mediaPlayer.duration || 0;
|
||||||
|
seekBar.value = mediaPlayer.currentTime;
|
||||||
|
const current = formatTime(mediaPlayer.currentTime);
|
||||||
|
const total = formatTime(mediaPlayer.duration);
|
||||||
|
timeDisplay.textContent = `${current} / ${total}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Seek media
|
||||||
|
seekBar.addEventListener('input', () => {
|
||||||
|
mediaPlayer.currentTime = seekBar.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handle volume
|
||||||
|
volumeBar.addEventListener('input', () => {
|
||||||
|
mediaPlayer.volume = volumeBar.value;
|
||||||
|
if (volumeBar.value == 0 || mediaPlayer.volume == 0) {
|
||||||
|
volumeBtn.textContent = "🔇";
|
||||||
|
} else {
|
||||||
|
volumeBtn.textContent = "🔊";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Show settings panel
|
||||||
|
settingsBtn.addEventListener('click', () => {
|
||||||
|
settingsDialogOverlay.style.display = 'block';
|
||||||
|
settingsPanel.style.display = 'block';
|
||||||
|
});
|
||||||
|
|
||||||
|
saveSettingsBtn.addEventListener('click', () => {
|
||||||
|
autoplayEnabled = autoplayCheckbox.checked;
|
||||||
|
loopEnabled = loopCheckbox.checked;
|
||||||
|
mediaPlayer.autoplay = autoplayEnabled;
|
||||||
|
mediaPlayer.loop = loopEnabled;
|
||||||
|
|
||||||
|
const controlsEnabled = document.getElementById('controlsCheckbox').checked;
|
||||||
|
const colorsEnabled = document.getElementById('colorsCheckbox').checked;
|
||||||
|
mediaPlayer.controls = controlsEnabled;
|
||||||
|
if (colorsEnabled) {
|
||||||
|
mediaPlayer.style.filter = "contrast(1.1) saturate(1.15) brightness(1.03)";
|
||||||
|
} else {
|
||||||
|
mediaPlayer.style.filter = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
settingsPanel.style.display = 'none';
|
||||||
|
settingsDialogOverlay.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// End of first event listener for DOM content loaded
|
||||||
|
|
||||||
|
// Format time
|
||||||
|
function formatTime(time) {
|
||||||
|
const minutes = Math.floor(time / 60) || 0;
|
||||||
|
const seconds = Math.floor(time % 60) || 0;
|
||||||
|
return `${minutes}:${seconds.toString().padStart(2, '0')}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const showDialogBtn = document.getElementById('showDialogBtn');
|
||||||
|
const hideDialogBtn = document.getElementById('hideDialogBtn');
|
||||||
|
const fullscreenBtn = document.getElementById('fullscreenBtn');
|
||||||
|
|
||||||
|
// Show dialog
|
||||||
|
showDialogBtn.addEventListener('click', () => {
|
||||||
|
dialogOverlay.style.display = 'block';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Hide dialog
|
||||||
|
hideDialogBtn.addEventListener('click', () => {
|
||||||
|
dialogOverlay.style.display = 'none';
|
||||||
|
});
|
||||||
|
|
||||||
|
// Fullscreen functionality
|
||||||
|
fullscreenBtn.addEventListener('click', () => {
|
||||||
|
if (!document.fullscreenElement) {
|
||||||
|
mediaPlayer.requestFullscreen();
|
||||||
|
} else {
|
||||||
|
document.exitFullscreen();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// End of code and second event listener for DOM content loaded
|
||||||
|
|
||||||
|
});
|
202
SimpliPlay UWP/WebAssets/styles.css
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: 'Inter';
|
||||||
|
src: url('fonts/Inter_18pt-Regular.ttf') format('truetype');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inter-header';
|
||||||
|
src: url('fonts/Inter_24pt-Bold.ttf');
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-family: "Inter-header", Arial, sans-serif !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
font-family: "Inter", Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: "Inter", Arial, sans-serif;
|
||||||
|
text-align: center;
|
||||||
|
padding: 20px;
|
||||||
|
margin: 0;
|
||||||
|
background: linear-gradient(135deg, #083358, #1a73e8);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#saveSettingsBtn:hover {
|
||||||
|
background: #0c63d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#saveSettingsBtn {
|
||||||
|
margin: 10px 5px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #1a73e8;
|
||||||
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog-overlay,
|
||||||
|
.subtitles-overlay {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba(0, 0, 0, 0.7);
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog,
|
||||||
|
.subtitles-dialog {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
background: #ffffff;
|
||||||
|
color: #333;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 10px;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 400px;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ccBtn {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog input[type="url"],
|
||||||
|
.subtitles-dialog input[type="url"] {
|
||||||
|
width: 80%;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog button,
|
||||||
|
.subtitles-dialog button {
|
||||||
|
margin: 10px 5px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #1a73e8;
|
||||||
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog button:hover,
|
||||||
|
.subtitles-dialog button:hover {
|
||||||
|
background: #0c63d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#customControls {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#customControls button,
|
||||||
|
input[type="range"] {
|
||||||
|
padding: 10px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 14px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#customControls button {
|
||||||
|
background: #1a73e8;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#customControls button:hover {
|
||||||
|
background: #0c63d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#showDialogBtn:hover {
|
||||||
|
background: #0c63d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="range"] {
|
||||||
|
flex-grow: 1;
|
||||||
|
background: transparent;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
video {
|
||||||
|
/* To make color pop: filter: contrast(1.1) saturate(1.2);*/
|
||||||
|
display: flex;
|
||||||
|
margin: 20px auto;
|
||||||
|
background: black;
|
||||||
|
width: 80vw;
|
||||||
|
height: 80vh;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.gap-box {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-info {
|
||||||
|
font-size: 0.85em;
|
||||||
|
color: #888;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#showDialogBtn {
|
||||||
|
margin: 10px 5px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #1a73e8;
|
||||||
|
color: white;
|
||||||
|
font-size: 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settingsBtn {
|
||||||
|
background: #1a73e8;
|
||||||
|
font-size: 18px;
|
||||||
|
border-radius: 50%;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settingsBtn:hover {
|
||||||
|
background: #0c63d9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fileInput {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#settingsPanel {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
background: #ffffff;
|
||||||
|
color: black;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
||||||
|
z-index: 10000;
|
||||||
|
text-align: center;
|
||||||
|
}
|