我有list个已下载的加密文件视频,但它们无法由默认的Android播放器播放..我创建了自己的播放器来播放加密视频。所以我想要的是,当用户点击加密的视频时,它弹出"完成动作?"然后他们选择所需的球员。我应该添加到我的播放器应用程序中以实现此目的?请帮忙
我希望我的视频播放器显示在列表中,如this
以下是获取所选视频路径的下一课程,如何获取路径?我希望玩家能够从我的下载中播放精选的视频。
import java.security.GeneralSecurityException;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
/**
* A PlayActivity variant that plays an encrypted video.
*/
public class PlayActivity2 extends APlayActivity {
@Override
public Cipher getCipher() throws GeneralSecurityException {
final Cipher c = Cipher.getInstance("ARC4"); // NoSuchAlgorithmException, NoSuchPaddingException
c.init(Cipher.DECRYPT_MODE, new SecretKeySpec("BrianIsInTheKitchen".getBytes(), "ARC4")); // InvalidKeyException
return c;
}
@Override
public String getPath() {
return "THE SELECTED PATH OF THE ENCRYPTED VIDEO";
}
}
答案 0 :(得分:0)
您可以尝试将此添加到
的manifest.xml
将您的活动注册为视频播放器
<!-- Video player -->
<activity android:name=".APlayActivity" android:label="@string/app_name"
android:screenOrientation="sensorLandscape">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="rtsp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
<data android:mimeType="application/sdp" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:mimeType="video/*" />
</intent-filter>
</activity>
答案 1 :(得分:0)
您需要声明Result = "201401,10|201402,35|201403,30|201404,37|201405,41|201406,57|201407,15|201408,12|201409,13|201410,9|201411,9|201412,9|201501,9"
您可以处理视频的文件格式,以便在您调用共享意图时调用播放器intent-filter
来播放视频。
例如,您可以在Activity
:
<activity>
中添加类似内容
Mainfest.xml
另请查看接收隐式意图下的文档here。