Allow fullscreen to video player in webview Nativescript-vue - nativescript

I'm building an application on Nativescript-vue where I'm using webview to play HTML5 video player in it. I want this video player to go fullscreen but I'm to able to see any controls, I did some research and I came to know that it I need to give permission for fullscreen.
<WebView #loaded="onWebViewLoaded($event)" :src="url_to_be_fetched" />
In my webview I required local storage access also which I overcome by:
onWebViewLoaded(args) {
console.log('check on load');
const webView = args.object;
if (webView.android) {
webView.android.getSettings().setDomStorageEnabled(true);
webView.android.getSettings().setDatabaseEnabled(true);
}
},
I came across the same issue but with angular AllowFullScreen in webview nativescript (angular)
I'm not sure how to implement in my vue app. I'm sure there must be some way out to it. Help me out, Thanks.

Related

Xamarin forms iOS splash screen with lottie animation before Xamarin App starts

I have implemented the Lottie animation splash screen on android with the new Intent, is there a way to do the same in iOS.
I know LaunchScreen.storyboard is unable to do this, but is there a way to generate a new UIViewController show it on screen with Lottie animation, and while the animation is playing in I will prepare Xamarin App in background task, and when animation ends call LoadApplication(app).
Or is there any other way to start playing Lottie animation first when you launch your app on iOS ?
Setting Lottie animation as the main page in Xamarin Forms is not an option, waiting on Xamarin Forms to start the app will take a few seconds and during that time I wanna show animation, not after.
iOS Launch screen can't animate. If startup time is an issue, and you want to show some animation, would need to write some "native code" (Xamarin.IOS is fine) that does an animation, while you have a background task do Xamarin Forms Init and load App ResourceDictionary. Details TBD, if someone demonstrates that they actually have a serious iOS load-time problem with Xamarin Forms.
OP (Original Poster) tested the time on iPhone, and concluded that it was fast enough to not be worth doing an animation to make that time more interesting. (On typical Android devices the startup time was longer.)

How to change Xamarin forms default webview browser to google chrome

In my application i want to change default webview browser
XAML
<WebView x:Name="webView" Grid.Row="1" Navigated="webView_Navigated">
</WebView>
C#
WebView web = new WebView()
{
Source = res.url,
};
webView.Source = web.Source;
When i am trying using like this facing issue with google authentication
error :
this browser or app may not be secure.
How can I resolve this issue ?
The message "this browser or app may not be secure." is not caused by the web view. You need to check the URL and the configuration.
Addressing the original question WebView is not very configurable. Xamarin Essentials have "Browser" but it is even less.
If you want to have more control over the web renderer you need to approach the problem with custom renderer using WebKit (for Android) and UIWebView (for iOS) controls.

webview xamarin forms does not play video on redicted website (ios and android)

I am currently using a web view to load some urls,I client reported that when clicking on an item on my menu and the webview is triggered and goes to one of their pages the video they have embedded on their page does not play.
Am I missing something basic here? eg permissions or is it a limitation of the webview?
also one of their links uses "#whatever" at the end and is meant to scrolldown and loading the page, but does not work. Is this supported?
many thanks

NativeScript full screen webview without bounce

How can i make a webView in NativeScript fullscreen including the statusbar. Not hide the statusbar only but the webview behind the statusbar like do this cordova.
And how can i prevent the webview of scrolling/bouncing
Thank you
UPDATE:
What i mean with the statusbar/fullscreen and cordova is in cordova is the statusbar transparent and the web view fullscreen.
and the other question is about the bouncing, in cordova can i prevent the webview from bouncing with this in the config.xml
<preference name="webviewbounce" value="false" />
Update:
The solution for the bounce is this:
var webView = page.getViewById('webView');
webView.ios.scrollView.bounces = false
How can make the statusbar transparent?
The solution was on the end.
ios:
put this in the plist file to make the statusbar "transparent"
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleLightContent</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
create a ios only file with this content to but the webview under the status bar
#webView{
margin-top: -20;
}
and add this to the page loaded function to prevent the webview of bouncing
if(page.ios){
webView.ios.scrollView.bounces = false
}
android:
is much simpler but this in the page wrapper of the webview to hide the titlebar
actionBarHidden="true"
i hope this helps anyone
I'm not following your question in regards to the statusbar and Cordova. However for the bouncing, the simplest option is to use this plugin which already has the native code for both iOS/android to remove the scroll bounce. See here: https://github.com/TheOriginalJosh/nativescript-swiss-army-knife#common-functions
If you can expand a bit more about what you want to do with the statusbar I can help there. I have a blog post detailing the android statusbar and navigation bar and a few things you can do natively with it in a few lines of code. https://bradmartin.net/2016/03/10/fullscreen-and-navigation-bar-color-in-a-nativescript-android-app/

Xamarin forms Android app verison goes blackscreen randomly

I got this app im been working on i xamarin forms. where i use a ContantPages inside a navigationspage. like shown below
MainPage = new NavigationPage(new SwipePage());
Now when i navigate to a other page like shown below, sometimes the screen goes black. If i then tap out of the app, and then tap in the app, the black screen will disappear, an the page content would be showing. making the app normally again.
this.Navigation.PushAsync(new ProfilPage());
I been trying to see if it's curse i load more data en app start, then resume. but i don't. its getting the same amount of load on resume, as on start.
So do anyone have a idea what it can be, or have tried something similar before?
Thanks for your time,
---UPDATE---
So In a emulator it runs without problems. but when i use a android device IRL it's keep doing that black screen thing.
I think this is occurring because you are not awaiting the async method thus showing a black screen as the page is still rendering but you have already been pushed to the page.
Try using the await operator.
var page = new SwipePage();
await Navigation.PushAsync(page);

Resources