mirror of
https://gitlab.com/vyla-entertainment/go.git
synced 2026-11-15 07:57:21 -05:00
removed the weird player logo on streams
This commit is contained in:
@@ -323,6 +323,45 @@ async fn download_and_extract_payload(app: tauri::AppHandle, window: WebviewWind
|
||||
Ok(base_dir)
|
||||
}
|
||||
|
||||
const ANDROID_VIDEO_FIX_SCRIPT: &str = r#"
|
||||
(function() {
|
||||
function suppressNativeOverlay() {
|
||||
const styleId = '__vyla_native_video_fix';
|
||||
if (!document.getElementById(styleId)) {
|
||||
const s = document.createElement('style');
|
||||
s.id = styleId;
|
||||
s.textContent = `
|
||||
video::-webkit-media-controls,
|
||||
video::-webkit-media-controls-enclosure,
|
||||
video::-webkit-media-controls-panel,
|
||||
video::-webkit-media-controls-overlay-play-button,
|
||||
video::-webkit-media-controls-start-playback-button {
|
||||
display: none !important;
|
||||
-webkit-appearance: none !important;
|
||||
opacity: 0 !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
`;
|
||||
(document.head || document.documentElement).appendChild(s);
|
||||
}
|
||||
|
||||
document.querySelectorAll('video').forEach(v => {
|
||||
v.setAttribute('playsinline', '');
|
||||
v.setAttribute('webkit-playsinline', '');
|
||||
v.removeAttribute('poster');
|
||||
});
|
||||
}
|
||||
|
||||
suppressNativeOverlay();
|
||||
new MutationObserver(suppressNativeOverlay).observe(document.documentElement, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
attributes: true,
|
||||
attributeFilter: ['poster']
|
||||
});
|
||||
})();
|
||||
"#;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
@@ -389,6 +428,10 @@ pub fn run() {
|
||||
.setup(|app| {
|
||||
let handle = app.handle().clone();
|
||||
|
||||
if let Some(window) = handle.get_webview_window("main") {
|
||||
let _ = window.eval(ANDROID_VIDEO_FIX_SCRIPT);
|
||||
}
|
||||
|
||||
tauri::async_runtime::spawn(async move {
|
||||
std::thread::sleep(std::time::Duration::from_millis(400));
|
||||
|
||||
@@ -398,7 +441,10 @@ pub fn run() {
|
||||
match download_and_extract_payload(handle.clone(), window.clone()).await {
|
||||
Ok(_) => {
|
||||
std::thread::sleep(std::time::Duration::from_millis(400));
|
||||
let _ = window.eval("window.location.replace('http://vyla.localhost/frontend/index.html');");
|
||||
let _ = window.eval(&format!(
|
||||
"{}; window.location.replace('http://vyla.localhost/frontend/index.html');",
|
||||
ANDROID_VIDEO_FIX_SCRIPT
|
||||
));
|
||||
}
|
||||
Err(err) => {
|
||||
update_ui(
|
||||
|
||||
Reference in New Issue
Block a user