使用外部URL的JWPlayer中的许可证密钥无效

时间:2017-03-20 12:36:27

标签: android jwplayer license-key

我正在尝试使用JWPlayer播放视频,其中包含以下网址: http://res.cloudinary.com/pawantrunkcloud/video/upload/v1489746294/g5ijnie2ri74loim4ezk.mp4

但是当我尝试播放Url时,我得到错误:

  

无效的许可密钥

Invalid License Key

播放视频的代码如下: 公共类VideoActivity扩展了Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_videoplay);



        // Get a handle to the JWPlayerFragment
        JWPlayerFragment fragment = (JWPlayerFragment) getFragmentManager().findFragmentById(R.id.playerFragment);

        // Get a handle to the JWPlayerView
        JWPlayerView playerView = fragment.getPlayer();

        // Create a PlaylistItem
        PlaylistItem video = new PlaylistItem("https://res.cloudinary.com/pawantrunkcloud/video/upload/v1489746294/g5ijnie2ri74loim4ezk.mp4");

        // Load a stream into the player

        playerView.load(video);
    }//onCreate closes here.....
}//VideoActivity closes here....

此外,许可证密钥如下:

public static final String JW_PLAYER_API_KEY = "tWdG7dmM";

public static final String JW_PLAYER_API_SECRET = "K5joAa8mzKQTHCGyndqgKbT7";

此外,许可证密钥已添加到清单:

<meta-data
            android:name="tWdG7dmM"
            android:value="K5joAa8mzKQTHCGyndqgKbT7"/>

1 个答案:

答案 0 :(得分:0)

它不是许可证密钥。转到仪表板。在左侧的仪表板页面中,您可以看到工具。选择工具。在工具页面中,您可以看到Ios,Android等许可证密钥...复制并粘贴到值的位置。名称是JW_LICENSE_KEY

<meta-data android:name="JW_LICENSE_KEY" android:value="{Your License Key from dashboard--> Tools}" /&GT;

只是每个用户的一个FYI。

不要用任何密钥替换JW_LICENSE_KEY,它是一个硬编码的字符串。 将许可证放在值部分中。

相关问题