vimeo video play in Android native

心已入冬 提交于 2019-11-26 04:27:32

问题


I am developing vimeo video app in native android. But it is not supported in VideoView. May I know any samples or related query for Android. I want final output to be in .mp3/.mp4 format.

I have tried iframe in Android WebView, It works well in Android WebView but I am not able to get seek bar. And OnPause() not able to Pause the video. Here I am able to get Pause and Play button Only

Example: player.vimeo.com/video/49462103

I want play this video in android native

 <VideoView
    android:layout_width=\"match_parent\"
    android:layout_height=\"wrap_content\"
    android:id=\"@+id/videoView\"
    android:layout_centerVertical=\"true\"
    android:layout_centerHorizontal=\"true\" />

Update link in : Vimeo site Thread-1 Vimeo site Thread-2

I am getting above error


回答1:


Vimeo's embed codes should work inside an Android WebView. Vimeo only offers .mp4 links to PRO users on those users own videos.

Another option is to use the official Deep Link library for the android application. This will let you open any vimeo video in the Android app.




回答2:


I made a native player for vimeo, base by WebView. Support public and private video.

Try it : https://github.com/ct7ct7ct7/Android-VimeoPlayer

<com.ct7ct7ct7.androidvimeoplayer.view.VimeoPlayerView
    android:id="@+id/vimeoPlayer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>



VimeoPlayerView vimeoPlayer = findViewById(R.id.vimeoPlayer);
getLifecycle().addObserver(vimeoPlayer);

//public video
vimeoPlayer.initialize(59777392);

//If video is open. but limit playing at embedded.
vimeoPlayer.initialize({YourPrivateVideoId}, "SettingsEmbeddedUrl")

//If video is pirvate.
vimeoPlayer.initialize({YourPrivateVideoId},"VideoHashKey", "SettingsEmbeddedUrl")


来源:https://stackoverflow.com/questions/35520783/vimeo-video-play-in-android-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!