dailymotion / dailymotion-swift-player-sdk-ios

Dailymotion Player SDK for iOS in Swift
MIT License
34 stars 15 forks source link

start parameter is not working #54

Open mobileteamtechaffinity opened 3 years ago

mobileteamtechaffinity commented 3 years ago

I have done a sample project with the below parameters and it's working correctly. After a month I tried the same parameters is not working and the video still starts from 0

let parameters: [String: Any] = [ "fullscreen-action": "trigger_event", "logo": "false", "sharing-action": "trigger_event", "start": Int(25) ] let controller = DMPlayerViewController(parameters: parameters) controller.delegate = self return controller }()

RemiGuyon commented 3 years ago

The start parameter should not be passed during the player init but when the video is loaded:

func loadVideo(_ videoId: String) {
  let parameters = [“start”: 30]
  guard
    let encoded = try? JSONEncoder().encode(parameters),
    let params = String(data: encoded, encoding: .utf8)
  else { return }

  playerViewController.load(videoId: videoId, params: params)
}