Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

[Android] Transparent window orientation error.


Go back to the portrait from landscape automatically when the device is rotated.

[Phone state]
Portrait > Device rotate by user. > Landscape > Portrait(Automatically)
-> Deleting 'PlayerConfig', does not automatically change the state.

[manifest.xml]
<activity
android:name=".Activity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="unspecified"
android:fitsSystemWindows="true"
android:theme="@style/Theme.Transparent"
android:windowSoftInputMode="adjustNothing"/>

[Style.xml]
<style name="Theme.Transparent" parent="@android:style/Theme.Black.NoTitleBar" >
<item name="android:windowIsTranslucent">true</item>
</style>

[activity.java]
.....
mPlayerView.setSkin("jwplayer_style.css");
new KeepScreenOnHandler(mPlayerView, getWindow());
PlayerConfig config = new PlayerConfig.Builder()
.image(image)
.file(vod)
.advertising(advertising)
.autostart(false)
.build();
mPlayerView.setup(config);
....

Any way to solve this?

9 Community Answers

George

JW Player Support Agent  
0 rated :

For me to reproduce this issue reliably I will need this information about your application:

Android API Build level (16,17… 22):
JW Player SDK for Android version number:
Device make and model where you are experiencing this issue:
Provide step by step instructions on how to reproduce your issue:
JW Player Demo Application Source Code that is also experiencing the issue:

As the last field suggests, please replicate this issue using the JW Player Demo Application and send us a link to a zipped version of the entire Android Studio Project for testing which can be found here:
https://github.com/jwplayer/jwplayer-sdk-android-demo

c...

User  
0 rated :

It doesn't work orientation.
I think, parent's orientation effect current activity.
Sample app doesn't work orientation.
I can't make same circumstances. please fix orientation config.

<application
android:name="com.jwplayer.opensourcedemo.MyApplication"
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/AppTheme">
<activity
android:name=".JWPlayerViewExample"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".JWPlayerFragmentExample"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
android:fitsSystemWindows="true"
android:windowSoftInputMode="adjustNothing" >
</activity>
<!--TODO Set your license key-->
<!--<meta-data-->
<!--android:name="JW_LICENSE_KEY"-->
<!--android:value="YOUR_LICENSE_KEY"/>-->
</application>

George

JW Player Support Agent  
0 rated :

For me to reproduce this issue reliably I will need this information about your application:

Android API Build level (16,17… 22):
JW Player SDK for Android version number:
Device make and model where you are experiencing this issue:
Provide step by step instructions on how to reproduce your issue:
JW Player Demo Application Source Code that is also experiencing the issue:

As the last field suggests, please replicate this issue using the JW Player Demo Application and send us a link to a zipped version of the entire Android Studio Project for testing which can be found here:
https://github.com/jwplayer/jwplayer-sdk-android-demo

c...

User  
0 rated :

Android API Build level (16,17… 22): API23
JW Player SDK for Android version number: build.gradle dependencies option: compile ('com.longtailvideo.jwplayer:jwplayer-android-sdk:2.2.2+')
Device make and model where you are experiencing this issue: LG v20, Samsung s6
Provide step by step instructions on how to reproduce your issue:
1. delete "android:windowIsTranslucent" style: orientation success or
2. jwplayer delete: orientation success
3. control orientation in program code on activity

JW Player Demo Application Source Code that is also experiencing the issue:
sample app did;'t works android:screenOrientation="portrait" option in activity.

George

JW Player Support Agent  
0 rated :

I’m not sure I follow your reproduction steps.

The activity config changes need to be in place
android:configChanges=“keyboard|keyboardHidden|orientation|screenSize” >
https://developer.jwplayer.com/sdk/android/docs/developer-guide/getting-started/library-project-setup/

For me to reproduce this issue reliably I will need this information about your application:

Android API Build level (16,17… 22):
JW Player SDK for Android version number:
Device make and model where you are experiencing this issue:
Provide step by step instructions on how to reproduce your issue:
JW Player Demo Application Source Code that is also experiencing the issue:

As the last field suggests, please replicate this issue using the JW Player Demo Application and send us a link to a zipped version of the entire Android Studio Project for testing which can be found here:
https://github.com/jwplayer/jwplayer-sdk-android-demo

c...

User  
0 rated :

1. Demo Application: sample app did't works android:screenOrientation="portrait" option.
- check below sample app.
- https://drive.google.com/file/d/0B6H1kiIv_HJZRTRnMGFUUEVvVlk/view?usp=sharing

2. Other question: Full screen error on 18:9 screen size
- Works well with 16: 9 screen sizes.
- Please let me know if you have any options to add.
PlayerConfig config = new PlayerConfig.Builder()
.image(image)
.file(vod)
.advertising(advertising)
.autostart(auto_start)
.build();

George

JW Player Support Agent  
0 rated :

Hi, you’d have to setup a player with a 18:9 aspect ratio and use the following stretching options:
https://developer.jwplayer.com/sdk/android/reference/com/longtailvideo/jwplayer/configuration/PlayerConfig.html#STRETCHING_EXACT_FIT

I think I understood what you want with the portrait orientation. The issue I assume is that when you go fullscreen the player is rotated into a landscape position. This is expected behavior, to avoid this you could extend the DefaultFullscreenHandler and override the doRotation() method. Don’t call super and don’t put any code in the method.
https://developer.jwplayer.com/sdk/android/reference/com/longtailvideo/jwplayer/fullscreen/DefaultFullscreenHandler.html
https://developer.jwplayer.com/sdk/android/reference/com/longtailvideo/jwplayer/JWPlayerView.html#setFullscreenHandler(com.longtailvideo.jwplayer.fullscreen.FullscreenHandler)

c...

User  
0 rated :

1. The 18: 9 ratio is supported since version 2.3.0, and I was not currently using 2.2.2. (Thank you. your answer)
I will update the version later. (If i update the version right now, i can not distribute the app because the advertisement does not come out.)

2. I want to set the default portrait mode in the manifest. (Ask again)
I want to control the land and port directly in the program.
Try the sample source link below. Even if you set the default portrait value in the manifest, if the user turns it to the left by the device sensor reaction, it is automatically changed horizontally.
- https://drive.google.com/file/d/0B6H1kiIv_HJZRTRnMGFUUEVvVlk/view?usp=sharing

I want to change by sensor response only when playing, and I want to portrait mode when play is stopped.

George

JW Player Support Agent  
0 rated :

To handle that you’ll have to use the FullscreenHandler interface:
https://developer.jwplayer.com/sdk/android/reference/com/longtailvideo/jwplayer/fullscreen/DefaultFullscreenHandler.html
https://developer.jwplayer.com/sdk/android/reference/com/longtailvideo/jwplayer/JWPlayerView.html#setFullscreenHandler(com.longtailvideo.jwplayer.fullscreen.FullscreenHandler)

This question has received the maximum number of answers.