Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can we change the surface type (from 360 to normal view) at runtime? #12

Closed
amer360 opened this issue Oct 28, 2021 · 4 comments
Closed

Comments

@amer360
Copy link

amer360 commented Oct 28, 2021

Can we change the surface type from 360 degrees to be a normal (2d) preview?

The problem is that I need to display a video ad in the middle of the video, but the ad is shown in 360 mode.
so we need to change the type when the ad starts, and change it back to the surface type(360) once the ad is complete.

I tried to change the projection type as you mentioned in the doc, but it didn't work

Thanks in advance

@trantako
Copy link
Contributor

Yes, this should work and it is OK to change the projection type at any time when playing a video stream (no need to pause/continue or anything like that). Many of our players have a separate button for toggling projection type at user's will.

There are two options:

  1. If your ad comes in the same video stream that normally contains 360 content, you want to switch that stream's output projection from Orion. There is an example:

https://github.com/FinweLtd/orion360-sdk-pro-examples-android/blob/master/app/src/main/java/fi/finwe/orion360/sdk/pro/examples/projection/Source.java

You probably need to swap the projection using this command when the ad begins:
mPanorama.setPanoramaType(OrionPanorama.PanoramaType.PANEL_SOURCE);

And, when the ad ends, return to 360 projection like this:
mPanorama.setPanoramaType(OrionPanorama.PanoramaType.SPHERE);

  1. If your ad is a separate stream, you could add a rectangular sprite to the 3D scene and play the ad stream in this panel. It will be locked into the 3D world like a TV screen attached to a wall of a room, and user can still look around - unless you temporarily prevent this by stopping sensor fusion and forcing a desired viewing angle.

There is an example of this approach, too:

https://github.com/FinweLtd/orion360-sdk-pro-examples-android/blob/master/app/src/main/java/fi/finwe/orion360/sdk/pro/examples/sprite/VideoSprite.java

@amer360
Copy link
Author

amer360 commented Oct 28, 2021

we are on option # 1 where the ad comes in the same video stream.
I tried the projection option as I mentioned in my question, but it didn't work. the video is not fit the screen size
Please check the following screenshot, I got this when I use OrionPanorama.PanoramaType.PANEL_SOURCE

screenshot-1635412499431

@amer360
Copy link
Author

amer360 commented Nov 28, 2021

Dear @trantako , your quick response is highly appreciated

Thank you

@trantako
Copy link
Contributor

There is now a separate document that discusses ads (SERVING_ADS.md) as well as 5 examples of different approaches.

Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants