2016-04-08 30 views
0

BrightCove'dan video indirmekle birlikte oynamak istediğim bir android uygulaması oluşturuyorum artık sorun, BrightCove'un kendi oyuncusu var, yani kullanamadığım com.brightcove.player.view.BrightcoveExoPlayerVideoView. Videoyu Android Native MediaPlayer'da oynamalıyım.BrightCove videosunun URL'sini indirin ve Stream'i indirin

Ben tüm dokümanları kontrol etmesini ve orada sadece tekrar bu gibi bazı şey sağlayacak ve

EventEmitter eventEmitter = brightcoveVideoView.getEventEmitter(); 
    Catalog catalog = new Catalog(eventEmitter, getString(R.string.account), getString(R.string.policy)); 

    catalog.findVideoByID(getString(R.string.videoId), new VideoListener() { 

     // Add the video found to the queue with add(). 
     // Start playback of the video with start(). 
     @Override 
     public void onVideo(Video video) { 
      brightcoveVideoView.add(video); 
      brightcoveVideoView.start(); 
     } 

     @Override 
     public void onError(String s) { 
      throw new RuntimeException(s); 
     } 
    }); 

Nasıl oynamaya ve indirme için kesin url alabilir mi yine?

zaman bazıları bu

{ "id" değerini döndürür servercalls/API_tester kullanarak BrightCove bir Video için arama: 1520880903001, "name": "Uzay-Galaxy", "adKeys": null, "shortDescription ": " ile Medya API video İçeriğini erişme için örnek olarak kullanılmış -", "longDescription SİLMEYİN: creationDate"
null "": "1332264917716", "publishedDate": "1332264917716",
" lastModifiedDate ":" 1441607273772 "," linkURL ": " http://support.brightcove.com/en/docs/accessing-video-content-media-api ", " linkText ":" Medya API'sı ile Video İçeriğine Erişme " , "Etiketleri": [ "newtag"], "videoStillURL": "http://brightcove.vo.llnwd.net/e1/pd/57838016001/57838016001_1520916808001_vs-1520911645001.jpg?pubId=57838016001", "thumbnailUrl": "http://brightcove.vo.llnwd.net/e1/pd/57838016001/57838016001_1520916809001_th-1520911645001.jpg?pubId=57838016001", "referenceid": "1520880903001", "uzunluk": 20000, "ekonomi": "AD_SUPPORTED", "playsTotal": 102, "playsTrailingWeek": 0,
"FLVURL": "rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & mP4: 57838016001 /57838016001_1520916807001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "yorumudur,": [ { "audioonly": yanlış, "controllerType": "varsayılan", "displayName": "Uzay-Galaxy.mp4", "encodingRate": 800000, "frameHeight": 360, "frameWidth": 640, "id": 1520959065001, "referenceid": null, " remoteStreamName ": null, "RemoteURL": null, "boyutu": 1829449, "uploadTimestampMillis": 1332267195355, "url":" rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/ rtmp/ondemand/& mP4: 57838016001/57838016001_1520959065001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "mP4", "videoduration": 20000 }, { "audioonly": false, "controllerType": "DEFAULT", "displayName": "Uzay-Galaxy.mp4", "encodingRate": 1800000, "frameHeight ": 720, "frameWidth": 1280 "kimlik": 1520962209001, "referenceid": null, "remoteStreamName": null, "RemoteURL": null, "boyut": 4.265.519, "uploadTimestampMillis" : 1332267361480, "url": "rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & mp4: 57838016001/57838016001_1520962209001_Space-Ga laxy.MP4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "MP4", "videoduration": 20000 } { "audioonly": yanlış, "controllerType": "STANDART " "displayName": "Uzay-Galaxy.mp4", "encodingRate": 1200000, "frameHeight": 404, "frameWidth": 720, "id": 1520962169001, "referenceid": null, "remoteStreamName": null, "remoteUrl": null, "size": 2777863, "uploadTimestampMillis": 1332267330633, "url": "rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & mp4: 57838016001/57838016001_1520962169001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "MP4", "videoduration": 20000 } { "audioonly": yanlış, "controllerType": "varsayılan", "displayName" : "Uzay-Galaxy.mp4", "encodingRate": 314758, "frameHeight": 224, "frameWidth": 400, " id ": 1520959023001, "referenceid": null, "remoteStreamName": null, "RemoteURL": null, "boyutu": 690193, "uploadTimestampMillis": 1332267165343, "url":" rtmp: // brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & mp4: 57838016001/57838016001_1520959023001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "MP4 " "videoduration": 20000 } { "audioonly": yanlış, "controllerType": "varsayılan", "displayName": "Uzay-Galaxy.mp4", "encodingRate": 500000, "frameHeight": 268, "frameWidth": 480, "id": 1520916807001, "referenceid": null, " remoteStreamName ": null, "RemoteURL": null, "boyutu": 1126642, "uploadTimestampMillis": 1332265138822, "url":" rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/ rtmp/ondemand/& mP4: 57838016001/57838016001_1520916807001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "mP4" "videoduration": 20000 }, { "audioonly": false, "controllerType": "DEFAULT", "displayName": "Uzay-Galaxy.mp4", "encodingRate": 129761, "frameHeight ": 224, "frameWidth": 400, "id": 1520953533001, "referenceid": null, "remoteStreamName": null, "RemoteURL": null, "boyutu": 227983, "uploadTimestampMillis" : 1332266955420, "url": "rtmp: //brightcove.fcod.llnwd.net/A500/e1/UDS/rtmp/ondemand/& mp4: 57838016001/57838016001_1520953533001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "MP4", "videoduration" : 20134 }], "FLVFullLength": { "audioonly": yanlış, "controllerType": "varsayılan", "displayName": "Alanda-Galaxy.mp4", "encodingRate": 500000, "frameHeight ": 268, " frameWidth ": 480, " id ": 1520916807001, " referenceId ": null, " remoteStreamName ": null, "RemoteURL": null, "boyutu": 1126642, "uploadTimestampMillis": 1332265138822, "url": "rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & MP4: 57838016001/57838016001_1520916807001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "MP4", "videoduration": 20000} "videoFullLength": { "audioonly" : false, "controllerType": "DEFAULT", "displayName": "Uzay-Galaxy.mp4", "encodingRate": 500000, "frameHeight": 268, "frameWidth": 480, "id": 1520916807001, "referenceid": null, "remoteStreamName": null, "RemoteURL": null, "boyutu": 1126642, "uploadTimestampMillis": 1332265138822, "url": "rtmp: //brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & mp4: 57838016001/57838016001_1520916807001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06" , "VideoCodec": "H264", "videoContainer": "MP4", "videoDuration": 20000}}

O

rtmp gibi bazı bağlantıları vardır: //brightcove.fcod.llnwd.net/a500/e1/uds/rtmp/ondemand/ & mp4: 57838016001/57838016001_1520959023001_Space-Galaxy.mp4 a99dcabb0f88cdf8d21b3a5778da8e06

ancak MediaPlayer'da hiçbir şey oynamıyor. rtmp ve rmtp nedeniyle olabilir Vitamio kullanmak zorunda olabilirim ama yerel MediaPlayer kullanmak için kısıtlı olduğum için yapamam.

IOS ile URL'leri şu adresten alabiliyorum: BCOVPlaybackService Ama androidde böyle bir sınıf yok.

Teşekkür

cevap

2

Tamam budur nasıl URL

EventEmitter eventEmitter = player.getEventEmitter(); 
      Catalog catalog = new Catalog(eventEmitter, account, privacy); 
      catalog.findVideoByID(video_brightcove_id, new VideoListener() { 
       @Override 
       public void onVideo(Video video) { 

        Map<DeliveryType, SourceCollection> map = video.getSourceCollections(); 
        Set<DeliveryType> st = map.keySet(); 
        SourceCollection sor = map.get(DeliveryType.valueOf("MP4")); 
        Set<Source> se = sor.getSources(); 
        Object[] ar = se.toArray(); 
        Source hp = (Source) ar[0]; 
        Map<String, Object> ma = hp.getProperties(); 
        String url = (String) ma.get("url"); 
       ////this is the video url 

       } 

       @Override 
       public void onError(String s) { 

        Log.e("Error ", s); 
       } 
      }); 

Teşekkür :)

+0

Ne DRM korumalı içeriğin böyle olacaktır alıyorum? Aynı zamanda MP4 –

+0

olarak teslim türünü de içerdiği için emin değilim ama evet MP4 olarak teslim türünü içerir. –

İlgili konular