如何使用VXG android sdk?

By simon at 2018-02-07 • 0人收藏 • 157人看过

请帮助如何使用* VXG Android SDK *并解决我有一个致命的错误 在使用它时面对。我使用了下面的代码配置媒体播放器和 按钮点击监听器来播放。

public class MainActivity extends AppCompatActivity  implements MediaPlayer.MediaPlayerCallback{
    public String videoUrl="http://130.185.144.63:8000/live/pakistan/pakistan/6.ts";        
    public MediaPlayer mediaPlayer;   
    public ProgressDialog progressDialog;    
    public Button btn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mediaPlayer=(MediaPlayer) findViewById(R.id.player); 
        mediaPlayer.getSurfaceView().setZOrderOnTop(true);   
        btn=(Button) findViewById(R.id.btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                try{
                    if(mediaPlayer!=null){   
                        mediaPlayer.getConfig().setConnectionUrl(videoUrl);
                        //this is place for the video configuration
                        MediaPlayerConfig mediaPlayerConfig=new MediaPlayerConfig();
                        mediaPlayerConfig.setConnectionUrl(videoUrl);
                        mediaPlayerConfig.setNumberOfCPUCores(0);
                        mediaPlayerConfig.setRendererType(1);
                        mediaPlayerConfig.setDecodingType(1);
                        mediaPlayerConfig.setSynchroEnable(1);
                        mediaPlayerConfig.setConnectionNetworkProtocol(-1);
                        mediaPlayer.Open(mediaPlayerConfig,MainActivity.this);
                        //end of the video place for the configuration
                    }//end of the conditional check
                    PrintToast("Working");
                }
                catch (Exception ex){
                    PrintToast("Exception of type "+ex.getMessage());
                }
            }
        });
    }//end of the on create activity




    //this is for the printing the toast
    public void PrintToast(String Line){
        Toast.makeText(getApplicationContext(),Line,Toast.LENGTH_SHORT).show();
    }

    @Override
    public int Status(int i) {
        if(i==MediaPlayer.PlayerNotifyCodes.PLP_PLAY_SUCCESSFUL.ordinal()){
        }
        return 0;
    }

    @Override
    public int OnReceiveData(ByteBuffer byteBuffer, int i, long l) {
        return 0;
    }
    //end of the printing the toast
}
当按钮被点击时,导致下面的fe大错误:
12-17 20:29:51.255 19811-19984/mashhood.meshsoft.com.vxgfullwork E/art: No implementation found for long veg.mediaplayer.sdk.MediaPlayer.nativePlayerInit(long[], veg.mediaplayer.sdk.MediaPlayer) (tried Java_veg_mediaplayer_sdk_MediaPlayer_nativePlayerInit and Java_veg_mediaplayer_sdk_MediaPlayer_nativePlayerInit___3JLveg_mediaplayer_sdk_MediaPlayer_2)
12-17 20:29:51.256 19811-19984/mashhood.meshsoft.com.vxgfullwork E/AndroidRuntime: FATAL EXCEPTION: MediaPlayerThread
                                                                                   Process: mashhood.meshsoft.com.vxgfullwork, PID: 19811
                                                                                   java.lang.UnsatisfiedLinkError: No implementation found for long veg.mediaplayer.sdk.MediaPlayer.nativePlayerInit(long[], veg.mediaplayer.sdk.MediaPlayer) (tried Java_veg_mediaplayer_sdk_MediaPlayer_nativePlayerInit and Java_veg_mediaplayer_sdk_MediaPlayer_nativePlayerInit___3JLveg_mediaplayer_sdk_MediaPlayer_2)
                                                                                       at veg.mediaplayer.sdk.MediaPlayer.nativePlayerInit(Native Method)
                                                                                       at veg.mediaplayer.sdk.MediaPlayerWorker.run(MediaPlayer.java:4051)
                                                                                       at java.lang.Thread.run(Thread.java:818)
所以请指导如何有效地使用它

1 个回复 | 最后更新于 2018-02-07
2018-02-07   #1

我在三星Galaxy S7上使用VXG时遇到了同样的错误,但是工作正常 罚款使用不同的Android设备。 VXG也有记录的问题可能对您有所帮助。 https://github.com/VideoExpertsGroup/VXG.Media.SDK.Android/issues/5

登录后方可回帖

Loading...