Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Story JSON doesn't produce valid video but amp works #8

Open
hackable opened this issue Mar 30, 2019 · 0 comments
Open

Story JSON doesn't produce valid video but amp works #8

hackable opened this issue Mar 30, 2019 · 0 comments

Comments

@hackable
Copy link

This works well for amp but not for video generation

{
  "version": 1,
  "title": "Story Title",
  "canonicalUrl": "https://example.com/story",
  "preview": {
     "publisher": "Story Title",
     "publisherLogoSrc": "https://news.files.bbci.co.uk/include/vjassets/img/bbcnewsicon256x256.png",
     "posterPortraitSrc": "https://example.com/publisher-logo"
  },
  "meta": {
    "datePublished": "2018-05-21",
    "dateModified": "1527857615255",
    "author": "BBC",
    "authorType": "Organization",
    "images": [
      "poster-square.jpg",
      "poster-portrait.jpg",
      "poster-landscape.jpg"
    ],
    "publisher": {
      "name": "BBC",
      "logo": {
        "url": "/bbc-news.png",
        "width": 600,
        "height": 60
      }
    },
    "description": "Some story description"
  },
  "bookendConfigSrc": "bookend.json",
  "pages": [
    {
      "layers": [
        {
          "type": "container",
          "styles": {
            "background-color": "black"
          }
        },
        {
          "annotation": "a image element",
          "type": "image",
          "source": "https://c.files.bbci.co.uk/F081/production/_106196516_fishcover.jpg",
          "layout": "responsive",
          "width": "720",
          "height": "1080",
          "alt": "an image"
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-start",
            "alignItems": "flex-start",
            "padding-left": "24px",
            "padding-top": "22px",
            "backgroundLinearGradient": {
              "direction": "180deg",
              "stops": [
                {
                  "color": "rgba(0, 0, 0, 0.5)",
                  "distance": "40px"
                },
                {
                  "color": "rgba(0, 0, 0, 0)",
                  "distance": "100px"
                }
              ]
            }
          },
          "elements": []
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-start",
            "alignItems": "flex-start",
            "padding-left": "24px",
            "padding-top": "22px",
            "backgroundLinearGradient": {
              "direction": "0deg",
              "stops": [
                {
                  "color": "black",
                  "distance": 30
                },
                {
                  "color": "transparent",
                  "distance": "50%"
                },
                {
                  "color": "rgba(0,0,0,0)"
                }
              ]
            }
          },
          "elements": [
            {
              "type": "image",
              "source": "https://news.files.bbci.co.uk/include/newslabs/ampstories/en/clear_strip_logo_22.png",
              "width": "147",
              "height": "22",
              "alt": "BBC News logo"
            }
          ]
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-end",
            "alignItems": "flex-start",
            "paddingLeft": "32px",
            "paddingRight": "32px",
            "padding": "25px"
          },
          "elements": [
            {
              "type": "paragraph",
              "text": "Some text",
              "styles": {
                "color": "#ffffff",
                "fontFamily": "sans-serif"
              }
            },
            {
              "type": "container",
              "styles": {
                "border-bottom": "4px solid #bb1919",
                "animate-in": "fade-in",
                "width": "200px",
                "padding-top": "10px"
              }
            }
          ]
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-end",
            "alignItems": "flex-end",
            "padding-right": "0px"
          },
          "elements": [
            {
              "type": "paragraph",
              "text": "Credit TEST",
              "styles": {
                "color": "#ececec",
                "backgroundColor": "rgba(0,0,0,0.6)",
                "fontFamily": "sans-serif",
                "padding": "3px 8px 1px",
                "fontSize": 13
              }
            }
          ]
        }
      ]
    },
    {
      "layers": [
        {
          "type": "video",
          "loop": true,
          "layout": "responsive",
          "height": 1280,
          "width": 720,
          "sources": [{
            "source":"https://vod-pro-ww-live.bbcfmt.hs.llnwd.net/av_pv25_pa3/modav/bUnknown-c9c0bec1-5d17-4c16-9b0d-315e1b03a5a2_p0735wqz_cUnknown_1552304950246.mp4?s=1553931253&e=1553974453&h=7396b6b6ecf530fbf5e7bb8e6d57c1c8",
            "type":"video/mp4"
          }]
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-start",
            "alignItems": "flex-start",
            "padding-left": "24px",
            "padding-top": "22px",
            "backgroundLinearGradient": {
              "direction": "180deg",
              "stops": [
                {
                  "color": "rgba(0, 0, 0, 0.5)",
                  "distance": "40px"
                },
                {
                  "color": "rgba(0, 0, 0, 0)",
                  "distance": "100px"
                }
              ]
            }
          },
          "elements": []
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-start",
            "alignItems": "flex-start",
            "padding-left": "24px",
            "padding-top": "22px",
            "backgroundLinearGradient": {
              "direction": "0deg",
              "stops": [
                {
                  "color": "black",
                  "distance": 30
                },
                {
                  "color": "transparent",
                  "distance": "50%"
                },
                {
                  "color": "rgba(0,0,0,0)"
                }
              ]
            }
          },
          "elements": [
            {
              "type": "image",
              "source": "https://news.files.bbci.co.uk/include/newslabs/ampstories/en/clear_strip_logo_22.png",
              "width": "147",
              "height": "22",
              "alt": "BBC News logo"
            }
          ]
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-end",
            "alignItems": "flex-start",
            "paddingLeft": "32px",
            "paddingRight": "32px",
            "padding": "25px"
          },
          "elements": [
            {
              "type": "paragraph",
              "text": "Some text",
              "styles": {
                "color": "#ffffff",
                "fontFamily": "sans-serif"
              }
            },
            {
              "type": "container",
              "styles": {
                "border-bottom": "4px solid #bb1919",
                "animate-in": "fade-in",
                "width": "200px",
                "padding-top": "10px"
              }
            }
          ]
        },
        {
          "type": "container",
          "styles": {
            "flexDirection": "column",
            "justifyContent": "flex-end",
            "alignItems": "flex-end",
            "padding-right": "0px"
          },
          "elements": [
            {
              "type": "paragraph",
              "text": "Credit TEST",
              "styles": {
                "color": "#ececec",
                "backgroundColor": "rgba(0,0,0,0.6)",
                "fontFamily": "sans-serif",
                "padding": "3px 8px 1px",
                "fontSize": 13
              }
            }
          ]
        }
      ]
    }

  ],
  "defaultStyles": {
    "heading": {
      "fontFamily": "sans-serif"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant