Playing Video from Within App

Play a video only from my app

You should try and use JWT (Json Web Token) to verify who is sending the request, you can use firebase and send the logged in user's token and use it's api to verify that the token is valid

How to play videos with phone's standard video player app

ShareCompat.IntentBuilder is for ACTION_SEND, which is not the typical Intent action for playing a video. ACTION_VIEW would be more typical. So, try:

private void passVideo(String videoname){
File videoPath = new File(Environment.getExternalStorageDirectory(), "video_folder");
File newFile = new File(videoPath, videoname);
Uri uri = FileProvider.getUriForFile(this, "com.example.provider", newFile);
Intent viewIntent = new Intent(Intent.ACTION_VIEW, uri);

viewIntent.setType(getContentResolver().getType(uri));
viewIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(viewIntent);
}

How can an app show YouTube videos and still meet Google's app guidelines?

You can fire an intent to open the video in a youtube app if it is present on the device or open it in the default browser. Now how do you get an event in the app if the youtube link is present on your website - This can be done by using javascript - http://tutorials.jenkov.com/android/android-web-apps-using-android-webview.html

Get URL of video running in Youtube android app

Answer to query 1:

Yes, it is possible to fetch the url of the video playing in the official YouTube app. You are trying to integrate your app with the YouTube app and there is a standard way of achieving it in android. You may get details of the technique here.

The concern at this point may be does YouTube app provides the url to be fetched from other apps. This requires the concept of content providers (here). One can integrate any app with another app but is restricted only to the data provided by the parent app. YouTube app allows one to fetch the metadata of the current playing video.

This is more related to android rather than YouTube API as you are trying to get information regarding the current state of the YouTube app.

Answer to query 2:

Yes, it will be illegal to develop such an app as per the terms and services of YouTube. That being said, you will not be permitted to publish your app to Google PlayStore. To quote the terms and services of YouTube:

"You shall not download any Content unless you see a “download” or similar link displayed by YouTube on the Service for that Content.You shall not copy, reproduce, make available online or electronically transmit, publish, adapt, distribute, transmit, broadcast, display, sell, license, or otherwise exploit any Content for any other purposes without the prior written consent of YouTube or the respective licensors of the Content. YouTube and its licensors reserve all rights not expressly granted in and to the Service and the Content."

You may read more about the terms and services of YouTube here.

Why would one still bother to develop such as app?

Though it would be illegal to earn financial benefit by such an app as it violates the terms and services of another app it depends on but still, it would be legal to develop such an app for personal use only. Upon quoting the terms and services again:

Content is provided to you AS IS. You may access Content for your information and personal use solely as intended through the provided functionality of the Service and as permitted under these Terms of Service. You shall not download any Content unless you see a “download” or similar link displayed by YouTube on the Service for that Content. You shall not copy, reproduce, make available online or electronically transmit, publish, adapt, distribute, transmit, broadcast, display, sell, license, or otherwise exploit any Content for any other purposes without the prior written consent of YouTube or the respective licensors of the Content. YouTube and its licensors reserve all rights not expressly granted in and to the Service and the Content.

The point of debate at this point might be: Is YouTube a service or content provider? One may argue on both sides.



Related Topics



Leave a reply



Submit