weixin_39872123
weixin_39872123
2020-12-31 15:20

Exoplayer2

Do you attend to support exoplayer2?

该提问来源于开源项目:gearvrf/GearVRf-Demos

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

16条回答

  • weixin_39606638 weixin_39606638 4月前

    Ive left the office for the week, ill post full details on Monday when I'm back at my work computer.

    Edit: M 8_21 I've loaded the same program up on a different phone (Samsung Galaxy S7) running Android 7.0 API 24. When trying to get a local file to play the following appears on the logcat screen filtered for warnings.

    The problem doesn't seem to be linked to file types as it not only affects hls streams and .mp4 local files but also occurred when playing a .mkv. As with the other files only sound was playing, there was no video.

    Log Pastebin: https://pastebin.com/5SXhvivM

    I'll post my relevant code within the next few minutes to show how I was intending to use exoplayer2, I was mainly attempting to replace the code from the previous version of exoplayer in place inside of the gvr-360video project from the samples for GearVRf.

    点赞 评论 复制链接分享
  • weixin_39606638 weixin_39606638 4月前

    I've pasted my current file. It was a modified version of the Minimal360VideoActivity from the gvr-360video project from the provided GearVRf samples. I'm using pastebin for the moment but I can set up a better storage method for other users soon, as I'm sure a few other people might be considering exoplayer2 for GearVRf projects.

    Pastebin: https://pastebin.com/BUj1H0jz

    点赞 评论 复制链接分享
  • weixin_39945789 weixin_39945789 4月前

    Looks like the same or similar issue to https://github.com/googlevr/gvr-android-sdk/issues/75

    which has a solution. Have to go dig through the check-ins and see what changed

    点赞 评论 复制链接分享
  • weixin_39607447 weixin_39607447 4月前

    At the end of the setSurface method you need to make a player.setVideoSurface(surface); call. In your code you never pass the surface to ExoPlayer.

    点赞 评论 复制链接分享
  • weixin_39606638 weixin_39606638 4月前

    That solved my problem, I apologize for the oversight. I'm still fairly new working with exoplayer. Once I've cleaned up my code I'll post a sample so anyone else looking to work with Exoplayer2 in GearVRf will have a reference.

    Working function now available at https://pastebin.com/SpkS0qNb Thanks Again.

    点赞 评论 复制链接分享
  • weixin_39607447 weixin_39607447 4月前

    Thanks for the effort. Can we close the issue now?

    点赞 评论 复制链接分享
  • weixin_39606638 weixin_39606638 4月前

    That seems to be fine at this point.

    点赞 评论 复制链接分享
  • weixin_39945789 weixin_39945789 4月前

    not sure there is any roadmap for that. What's the feature you need that's not in the Android Media player or Exoplayer 1?

    点赞 评论 复制链接分享
  • weixin_39872123 weixin_39872123 4月前

    The only reason i need is that i am working with exoplayer2 now. Also, if i understand correctly Exoplayer2 is the version they are improving and developing now. So the exoplayer1 will be outdated soon.

    点赞 评论 复制链接分享
  • weixin_39607447 weixin_39607447 4月前

    In your experience are the API changes in v2 major? v2 will be the go to version for Android O.

    点赞 评论 复制链接分享
  • weixin_39603588 weixin_39603588 4月前

    Is there anything that prevents this right now? Right now, our 'support' for ExoPlayer is showing developers how to use it in a GVRVideoSceneObjectPlayer<> interface. And that code is in the gvr-360video sample (in the Activtity class). Is there something that prevents a developer from doing the same thing with ExoPlayer2?

    点赞 评论 复制链接分享
  • weixin_39607447 weixin_39607447 4月前

    Nothing prevents it to my knowledge. But it has to be tried to determine how different the ExoPlayer2 API is. You never know.. For example, the Android YouTube API requires you to derive from an activity of its own which means we can't use it.

    点赞 评论 复制链接分享
  • weixin_39607447 weixin_39607447 4月前

    Did you manage to switch to ExoPlayer2?

    点赞 评论 复制链接分享
  • weixin_39606638 weixin_39606638 4月前

    I've tried to get exoplayer2 working with some issue. Its very possible that I'm making a mistake that is not related to GearVRf however at present the player will open without logging any errors but display a black screen for a local HLS stream. The only warnings I'm getting are about unsupported mime types.

    Audio from sources is playing correctly, though there is not video from HLS stream source or file source.

    点赞 评论 复制链接分享
  • weixin_39945789 weixin_39945789 4月前

    That could be a video codec issue or something inherent with exoplayer2.

    Can you play on the same phone with a different player?

    点赞 评论 复制链接分享
  • weixin_39607447 weixin_39607447 4月前

    If you can share with us a sample project we might be able to help you quicker.

    点赞 评论 复制链接分享

相关推荐