在Angular中使用RSS视频提要

时间:2019-05-03 17:05:11

标签: angular api

我是Angular的新手。我正在编写Angular7应用程序,以使用XML格式的视频和图像提要。有几种提要,但不知道如何处理。

我在Angular中有书面服务。这些视频超出了我在下面提供的内容。它直接从

获取api
  

http://api.feeds.com/article/1x1qiywrbt7

视频API

http://api.feeds.com/article/1x1qiywrbt7?_fmt=xml&_rt=b&ctg=english%20football%20sms&_fld=tsr&kwd=cc
http://api.feeds.com/article/1x1qiywrbt7?_fmt=xml&_rt=b&ctg=english%20football%20sms&_fld=tsr&kwd=ll
http://api.feeds.com/article/1x1qiywrbt7?_fmt=xml&_rt=b&ctg=english%20football%20sms&_fld=tsr&kwd=m%20ct

video.service

import { Injectable } from '@angular/core';
import { HttpClient } from "@angular/common/http";
import { Observable } from "rxjs";
import { Cacheable } from 'ngx-cacheable';


@Injectable({
  providedIn: 'root'
})
export class VideoService {

  private mmContentUrl = 'http://api.feeds.com/article/1x1qiywrbt7?';

  constructor(private http: HttpClient) { }

    /** GET data from API and cache the results */
    @Cacheable()
    getVideos(): Observable<Feed[]> {
      return this.http.get<Feed[]>(this.axinomContentUrl + '_catalog.json')  
    }

    getVideo(video): Observable<Video[]> {
      return this.http.get<Video[]>(this.mmContentUrl + video + '/metadata.json' )
    }

}

我希望Angular将视频显示为小部件(很多)

0 个答案:

没有答案